123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- //go:build wireinject
- // +build wireinject
- package wire
- import (
- "github.com/go-nunu/nunu-layout-advanced/internal/job"
- "github.com/go-nunu/nunu-layout-advanced/internal/repository"
- "github.com/go-nunu/nunu-layout-advanced/internal/repository/admin"
- flexCdn2 "github.com/go-nunu/nunu-layout-advanced/internal/repository/api/flexCdn"
- waf2 "github.com/go-nunu/nunu-layout-advanced/internal/repository/api/waf"
- "github.com/go-nunu/nunu-layout-advanced/internal/server"
- "github.com/go-nunu/nunu-layout-advanced/internal/service"
- "github.com/go-nunu/nunu-layout-advanced/internal/service/api/flexCdn"
- "github.com/go-nunu/nunu-layout-advanced/internal/service/api/gameShield"
- "github.com/go-nunu/nunu-layout-advanced/internal/service/api/waf"
- "github.com/go-nunu/nunu-layout-advanced/internal/task"
- "github.com/go-nunu/nunu-layout-advanced/pkg/app"
- "github.com/go-nunu/nunu-layout-advanced/pkg/jwt"
- "github.com/go-nunu/nunu-layout-advanced/pkg/log"
- "github.com/go-nunu/nunu-layout-advanced/pkg/sid"
- "github.com/google/wire"
- "github.com/spf13/viper"
- )
- var repositorySet = wire.NewSet(
- repository.NewDB,
- repository.NewRedis,
- repository.NewMongoClient,
- repository.NewCasbinEnforcer,
- repository.NewMongoDB,
- repository.NewRabbitMQ,
- repository.NewRepository,
- repository.NewTransaction,
- admin.NewUserRepository,
- repository.NewGameShieldRepository,
- repository.NewGameShieldBackendRepository,
- repository.NewGameShieldPublicIpRepository,
- repository.NewHostRepository,
- repository.NewGameShieldUserIpRepository,
- repository.NewGameShieldSdkIpRepository,
- waf2.NewWebForwardingRepository,
- waf2.NewTcpforwardingRepository,
- waf2.NewUdpForWardingRepository,
- waf2.NewGlobalLimitRepository,
- repository.NewGatewayGroupRepository,
- repository.NewGateWayGroupIpRepository,
- flexCdn2.NewCdnRepository,
- repository.NewExpiredRepository,
- flexCdn2.NewProxyRepository,
- waf2.NewGatewayipRepository,
- repository.NewLogRepository,
- flexCdn2.NewCcRepository,
- flexCdn2.NewCcIpListRepository,
- )
- var taskSet = wire.NewSet(
- task.NewTask,
- task.NewUserTask,
- task.NewGameShieldTask,
- task.NewWafTask,
- )
- var jobSet = wire.NewSet(
- job.NewJob,
- job.NewUserJob,
- job.NewWhitelistJob,
- )
- var serverSet = wire.NewSet(
- server.NewTaskServer,
- server.NewJobServer,
- )
- var serviceSet = wire.NewSet(
- service.NewService,
- service.NewAoDunService,
- gameShield.NewGameShieldService,
- service.NewCrawlerService,
- service.NewGameShieldPublicIpService,
- service.NewDuedateService,
- service.NewFormatterService,
- service.NewParserService,
- service.NewRequiredService,
- service.NewHostService,
- gameShield.NewGameShieldBackendService,
- service.NewGameShieldSdkIpService,
- service.NewGameShieldUserIpService,
- waf.NewWafFormatterService,
- flexCdn.NewCdnService,
- service.NewRequestService,
- waf.NewTcpforwardingService,
- waf.NewUdpForWardingService,
- waf.NewWebForwardingService,
- flexCdn.NewProxyService,
- flexCdn.NewSslCertService,
- flexCdn.NewWebsocketService,
- flexCdn.NewCcService,
- waf.NewGatewayipService,
- service.NewLogService,
- flexCdn.NewCcIpListService,
- )
- // build App
- func newApp(
- task *server.TaskServer,
- jobServer *server.JobServer,
- ) *app.App {
- return app.NewApp(
- app.WithServer(task, jobServer),
- app.WithName("demo-task"),
- )
- }
- func NewWire(*viper.Viper, *log.Logger) (*app.App, func(), error) {
- panic(wire.Build(
- repositorySet,
- taskSet,
- jobSet,
- serverSet,
- serviceSet,
- newApp,
- sid.NewSid,
- jwt.NewJwt,
- ))
- }
|