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
+3 -3
View File
@@ -6,10 +6,10 @@ import (
"net/http"
"reflect"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/licensing"
)
var (
@@ -18,7 +18,7 @@ var (
type FeatureManager struct {
isDevMod bool
licensing models.Licensing
licensing licensing.Licensing
flags map[string]*FeatureFlag
enabled map[string]bool // only the "on" values
config string // path to config file
+5 -5
View File
@@ -5,12 +5,12 @@ import (
"os"
"path/filepath"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/licensing"
"github.com/grafana/grafana/pkg/setting"
)
var (
@@ -22,7 +22,7 @@ var (
}, []string{"name"})
)
func ProvideManagerService(cfg *setting.Cfg, licensing models.Licensing) (*FeatureManager, error) {
func ProvideManagerService(cfg *setting.Cfg, licensing licensing.Licensing) (*FeatureManager, error) {
mgmt := &FeatureManager{
isDevMod: setting.Env != setting.Prod,
licensing: licensing,
+4 -3
View File
@@ -3,9 +3,10 @@ package featuremgmt
import (
"testing"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/licensing"
"github.com/grafana/grafana/pkg/setting"
)
func TestFeatureService(t *testing.T) {
@@ -47,7 +48,7 @@ func TestFeatureService(t *testing.T) {
}
var (
_ models.Licensing = (*stubLicenseServier)(nil)
_ licensing.Licensing = (*stubLicenseServier)(nil)
)
type stubLicenseServier struct {