The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/pluginsintegration/licensing/licensing.go

48 lines
945 B

package licensing
import (
"fmt"
"github.com/grafana/grafana/pkg/services/licensing"
"github.com/grafana/grafana/pkg/setting"
)
type Service struct {
licensePath string
appURL string
license licensing.Licensing
}
func ProvideLicensing(cfg *setting.Cfg, l licensing.Licensing) *Service {
return &Service{
licensePath: cfg.EnterpriseLicensePath,
appURL: cfg.AppURL,
license: l,
}
}
func (l *Service) Environment() []string {
var env []string
if envProvider, ok := l.license.(licensing.LicenseEnvironment); ok {
for k, v := range envProvider.Environment() {
env = append(env, fmt.Sprintf("%s=%s", k, v))
}
}
return env
}
func (l *Service) Edition() string {
return l.license.Edition()
}
func (l *Service) Path() string {
return l.licensePath
}
func (l *Service) AppURL() string {
return l.appURL
}
func (l *Service) ContentDeliveryPrefix() string {
return l.license.ContentDeliveryPrefix()
}