chore: move models/licensing into licensing service (#61878)

This commit is contained in:
Kristin Laemmert
2023-01-23 11:53:43 -05:00
committed by GitHub
parent 50faeba07e
commit 857649e30b
13 changed files with 39 additions and 36 deletions
+4 -4
View File
@@ -3,16 +3,16 @@ package licensing
import (
"fmt"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/licensing"
"github.com/grafana/grafana/pkg/setting"
)
type Service struct {
licensePath string
license models.Licensing
license licensing.Licensing
}
func ProvideLicensing(cfg *setting.Cfg, l models.Licensing) *Service {
func ProvideLicensing(cfg *setting.Cfg, l licensing.Licensing) *Service {
return &Service{
licensePath: cfg.EnterpriseLicensePath,
license: l,
@@ -21,7 +21,7 @@ func ProvideLicensing(cfg *setting.Cfg, l models.Licensing) *Service {
func (l Service) Environment() []string {
var env []string
if envProvider, ok := l.license.(models.LicenseEnvironment); ok {
if envProvider, ok := l.license.(licensing.LicenseEnvironment); ok {
for k, v := range envProvider.Environment() {
env = append(env, fmt.Sprintf("%s=%s", k, v))
}