grafana/pkg/server/runner.go
Serge Zaitsev 2d30f33ad8
Chore: Unite wire graphs for cli and server (#61143)
* Chore: unite wire graphs for cli and server

* remove cli wire once again

* try to fix runner wire injection

* unify runner initialisation
2023-03-17 16:36:39 +01:00

40 lines
1.2 KiB
Go

package server
import (
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/services/encryption"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/secrets"
"github.com/grafana/grafana/pkg/services/secrets/manager"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
)
type Runner struct {
Cfg *setting.Cfg
SQLStore db.DB
SettingsProvider setting.Provider
Features featuremgmt.FeatureToggles
EncryptionService encryption.Internal
SecretsService *manager.SecretsService
SecretsMigrator secrets.Migrator
UserService user.Service
}
func NewRunner(cfg *setting.Cfg, sqlStore db.DB, settingsProvider setting.Provider,
encryptionService encryption.Internal, features featuremgmt.FeatureToggles,
secretsService *manager.SecretsService, secretsMigrator secrets.Migrator,
userService user.Service,
) Runner {
return Runner{
Cfg: cfg,
SQLStore: sqlStore,
SettingsProvider: settingsProvider,
EncryptionService: encryptionService,
SecretsService: secretsService,
SecretsMigrator: secretsMigrator,
Features: features,
UserService: userService,
}
}