grafana/pkg/server/usagestatssvcs/usage_stats_providers_registry.go
Karl Persson 55c7b8add2
RBAC: Split up service into several components (#54002)
* RBAC: Rename interface to Store

* RBAC: Move ranme scopeInjector

* RBAC: Rename files to service

* RBAC: Rename to service

* RBAC: Split up accesscontrol into two components

* RBAC: Add DeclareFixedRoles to AccessControl interface

* Wire: Fix wire bindings

* RBAC: Move resolvers to root

* RBAC: Remove invalid test

* RBAC: Inject access control service

* RBAC: Implement the RoleRegistry interface in fake
2022-08-24 13:29:17 +02:00

30 lines
757 B
Go

package usagestatssvcs
import (
"github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/thumbs"
)
func ProvideUsageStatsProvidersRegistry(
thumbsService thumbs.Service,
accesscontrol accesscontrol.Service,
) *UsageStatsProvidersRegistry {
return NewUsageStatsProvidersRegistry(
thumbsService,
accesscontrol,
)
}
type UsageStatsProvidersRegistry struct {
Services []registry.ProvidesUsageStats
}
func NewUsageStatsProvidersRegistry(services ...registry.ProvidesUsageStats) *UsageStatsProvidersRegistry {
return &UsageStatsProvidersRegistry{services}
}
func (r *UsageStatsProvidersRegistry) GetServices() []registry.ProvidesUsageStats {
return r.Services
}