harness-drone/cmd/drone-server/wire_gen.go

113 lines
5.4 KiB
Go
Raw Normal View History

2019-02-19 23:56:41 +00:00
// Code generated by Wire. DO NOT EDIT.
//go:generate wire
//+build !wireinject
package main
import (
"github.com/drone/drone/cmd/drone-server/config"
"github.com/drone/drone/handler/api"
"github.com/drone/drone/handler/web"
"github.com/drone/drone/livelog"
"github.com/drone/drone/operator/manager"
"github.com/drone/drone/pubsub"
2019-10-02 06:28:57 +00:00
"github.com/drone/drone/service/canceler"
2019-02-19 23:56:41 +00:00
"github.com/drone/drone/service/commit"
"github.com/drone/drone/service/hook/parser"
"github.com/drone/drone/service/license"
"github.com/drone/drone/service/linker"
2019-02-19 23:56:41 +00:00
"github.com/drone/drone/service/token"
"github.com/drone/drone/service/transfer"
2019-02-19 23:56:41 +00:00
"github.com/drone/drone/service/user"
"github.com/drone/drone/store/cron"
"github.com/drone/drone/store/perm"
"github.com/drone/drone/store/secret"
2019-04-15 00:06:16 +00:00
"github.com/drone/drone/store/secret/global"
2019-02-19 23:56:41 +00:00
"github.com/drone/drone/store/step"
"github.com/drone/drone/trigger"
cron2 "github.com/drone/drone/trigger/cron"
)
import (
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"
)
// Injectors from wire.go:
func InitializeApplication(config2 config.Config) (application, error) {
client := provideClient(config2)
refresher := provideRefresher(config2)
db, err := provideDatabase(config2)
if err != nil {
return application{}, err
}
encrypter, err := provideEncrypter(config2)
if err != nil {
return application{}, err
}
userStore := provideUserStore(db, encrypter, config2)
2019-02-19 23:56:41 +00:00
renewer := token.Renewer(refresher, userStore)
commitService := commit.New(client, renewer)
cronStore := cron.New(db)
repositoryStore := provideRepoStore(db)
buildStore := provideBuildStore(db)
2019-10-02 15:23:56 +00:00
corePubsub := pubsub.New()
2019-02-19 23:56:41 +00:00
stageStore := provideStageStore(db)
scheduler := provideScheduler(stageStore, config2)
2019-10-02 06:28:57 +00:00
statusService := provideStatusService(client, renewer, config2)
stepStore := step.New(db)
2019-04-16 15:21:05 +00:00
system := provideSystem(config2)
webhookSender := provideWebhookPlugin(config2, system)
2019-10-02 15:23:56 +00:00
coreCanceler := canceler.New(buildStore, corePubsub, repositoryStore, scheduler, stageStore, statusService, stepStore, userStore, webhookSender)
2019-10-02 06:28:57 +00:00
fileService := provideContentService(client, renewer)
configService := provideConfigPlugin(client, fileService, config2)
convertService := provideConvertPlugin(client, config2)
validateService := provideValidatePlugin(config2)
triggerer := trigger.New(coreCanceler, configService, convertService, commitService, statusService, buildStore, scheduler, repositoryStore, userStore, validateService, webhookSender)
2019-02-19 23:56:41 +00:00
cronScheduler := cron2.New(commitService, cronStore, repositoryStore, userStore, triggerer)
2020-06-05 02:15:30 +00:00
reaper := provideReaper(repositoryStore, buildStore, stageStore, coreCanceler, config2)
2019-03-13 21:47:47 +00:00
coreLicense := provideLicense(client, config2)
datadog := provideDatadog(userStore, repositoryStore, buildStore, system, coreLicense, config2)
2019-02-19 23:56:41 +00:00
logStore := provideLogStore(db, config2)
logStream := livelog.New()
netrcService := provideNetrcService(client, renewer, config2)
secretStore := secret.New(db, encrypter)
2019-04-15 00:06:16 +00:00
globalSecretStore := global.New(db, encrypter)
2019-09-03 06:05:30 +00:00
buildManager := manager.New(buildStore, configService, convertService, corePubsub, logStore, logStream, netrcService, repositoryStore, scheduler, secretStore, globalSecretStore, statusService, stageStore, stepStore, system, userStore, webhookSender)
2019-02-19 23:56:41 +00:00
secretService := provideSecretPlugin(config2)
registryService := provideRegistryPlugin(config2)
runner := provideRunner(buildManager, secretService, registryService, config2)
hookService := provideHookService(client, renewer, config2)
licenseService := license.NewService(userStore, repositoryStore, buildStore, coreLicense)
organizationService := provideOrgService(client, renewer)
2019-02-19 23:56:41 +00:00
permStore := perm.New(db)
repositoryService := provideRepositoryService(client, renewer, config2)
2019-06-06 20:27:38 +00:00
session, err := provideSession(userStore, config2)
if err != nil {
return application{}, err
}
2019-09-28 21:27:37 +00:00
batcher := provideBatchStore(db, config2)
2019-02-19 23:56:41 +00:00
syncer := provideSyncer(repositoryService, repositoryStore, userStore, batcher, config2)
transferer := transfer.New(repositoryStore, permStore)
2019-09-28 21:27:37 +00:00
userService := user.New(client, renewer)
server := api.New(buildStore, commitService, cronStore, corePubsub, globalSecretStore, hookService, logStore, coreLicense, licenseService, organizationService, permStore, repositoryStore, repositoryService, scheduler, secretStore, stageStore, stepStore, statusService, session, logStream, syncer, system, transferer, triggerer, userStore, userService, webhookSender)
2019-02-19 23:56:41 +00:00
admissionService := provideAdmissionPlugin(client, organizationService, userService, config2)
hookParser := parser.New(client)
2019-09-21 01:17:32 +00:00
coreLinker := linker.New(client)
2019-02-19 23:56:41 +00:00
middleware := provideLogin(config2)
options := provideServerOptions(config2)
2019-09-21 01:17:32 +00:00
webServer := web.New(admissionService, buildStore, client, hookParser, coreLicense, licenseService, coreLinker, middleware, repositoryStore, session, syncer, triggerer, userStore, userService, webhookSender, options, system)
2019-05-21 20:29:58 +00:00
mainRpcHandlerV1 := provideRPC(buildManager, config2)
mainRpcHandlerV2 := provideRPC2(buildManager, config2)
mainHealthzHandler := provideHealthz()
2019-04-24 22:33:00 +00:00
metricServer := provideMetric(session, config2)
2019-12-30 01:59:42 +00:00
mainPprofHandler := providePprof(config2)
mux := provideRouter(server, webServer, mainRpcHandlerV1, mainRpcHandlerV2, mainHealthzHandler, metricServer, mainPprofHandler)
2019-02-19 23:56:41 +00:00
serverServer := provideServer(mux, config2)
2020-06-05 02:15:30 +00:00
mainApplication := newApplication(cronScheduler, reaper, datadog, runner, serverServer, userStore)
2019-02-19 23:56:41 +00:00
return mainApplication, nil
}