mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
6b8c77c70c
* add interface for stats * add user service to registry
30 lines
735 B
Go
30 lines
735 B
Go
package usagestatssvcs
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/registry"
|
|
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
|
"github.com/grafana/grafana/pkg/services/user"
|
|
)
|
|
|
|
func ProvideUsageStatsProvidersRegistry(
|
|
accesscontrol accesscontrol.Service,
|
|
user user.Service,
|
|
) *UsageStatsProvidersRegistry {
|
|
return NewUsageStatsProvidersRegistry(
|
|
accesscontrol,
|
|
user,
|
|
)
|
|
}
|
|
|
|
type UsageStatsProvidersRegistry struct {
|
|
Services []registry.ProvidesUsageStats
|
|
}
|
|
|
|
func NewUsageStatsProvidersRegistry(services ...registry.ProvidesUsageStats) *UsageStatsProvidersRegistry {
|
|
return &UsageStatsProvidersRegistry{services}
|
|
}
|
|
|
|
func (r *UsageStatsProvidersRegistry) GetServices() []registry.ProvidesUsageStats {
|
|
return r.Services
|
|
}
|