// Code generated by Wire. DO NOT EDIT.

//go:generate go run -mod=mod github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject

package wire

import (
	"github.com/go-nunu/nunu-layout-advanced/internal/handler"
	"github.com/go-nunu/nunu-layout-advanced/internal/middleware"
	"github.com/go-nunu/nunu-layout-advanced/internal/repository"
	"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/pkg/app"
	"github.com/go-nunu/nunu-layout-advanced/pkg/jwt"
	"github.com/go-nunu/nunu-layout-advanced/pkg/limiter"
	"github.com/go-nunu/nunu-layout-advanced/pkg/log"
	"github.com/go-nunu/nunu-layout-advanced/pkg/server/http"
	"github.com/go-nunu/nunu-layout-advanced/pkg/sid"
	"github.com/google/wire"
	"github.com/spf13/viper"
)

// Injectors from wire.go:

func NewWire(viperViper *viper.Viper, logger *log.Logger) (*app.App, func(), error) {
	jwtJWT := jwt.NewJwt(viperViper)
	db := repository.NewDB(viperViper, logger)
	syncedEnforcer := repository.NewCasbinEnforcer(viperViper, logger, db)
	limiterLimiter := limiter.NewLimiter(viperViper)
	handlerFunc := middleware.NewRateLimitMiddleware(limiterLimiter)
	handlerHandler := handler.NewHandler(logger)
	client := repository.NewRedis(viperViper)
	qmgoClient := repository.NewMongoClient(viperViper)
	database := repository.NewMongoDB(qmgoClient, viperViper)
	rabbitMQ, cleanup := repository.NewRabbitMQ(viperViper, logger)
	repositoryRepository := repository.NewRepository(logger, db, client, qmgoClient, database, rabbitMQ, syncedEnforcer)
	transaction := repository.NewTransaction(repositoryRepository)
	sidSid := sid.NewSid()
	serviceService := service.NewService(transaction, logger, sidSid, jwtJWT)
	userRepository := repository.NewUserRepository(repositoryRepository)
	userService := service.NewUserService(serviceService, userRepository)
	userHandler := handler.NewUserHandler(handlerHandler, userService)
	gameShieldRepository := repository.NewGameShieldRepository(repositoryRepository)
	parserService := service.NewParserService(serviceService)
	crawlerService := service.NewCrawlerService(serviceService, parserService, viperViper)
	gameShieldPublicIpRepository := repository.NewGameShieldPublicIpRepository(repositoryRepository)
	gameShieldUserIpRepository := repository.NewGameShieldUserIpRepository(repositoryRepository)
	gameShieldPublicIpService := service.NewGameShieldPublicIpService(serviceService, gameShieldPublicIpRepository, gameShieldUserIpRepository)
	duedateService := service.NewDuedateService(serviceService, gameShieldRepository)
	gameShieldBackendRepository := repository.NewGameShieldBackendRepository(repositoryRepository)
	hostRepository := repository.NewHostRepository(repositoryRepository)
	hostService := service.NewHostService(serviceService, hostRepository)
	formatterService := service.NewFormatterService(serviceService, gameShieldPublicIpService, gameShieldBackendRepository, hostService)
	requiredService := service.NewRequiredService(serviceService, crawlerService, viperViper)
	gameShieldSdkIpRepository := repository.NewGameShieldSdkIpRepository(repositoryRepository)
	gameShieldSdkIpService := service.NewGameShieldSdkIpService(serviceService, gameShieldSdkIpRepository)
	gameShieldService := service.NewGameShieldService(serviceService, gameShieldRepository, crawlerService, gameShieldPublicIpService, duedateService, formatterService, parserService, requiredService, viperViper, gameShieldSdkIpService)
	gameShieldHandler := handler.NewGameShieldHandler(handlerHandler, gameShieldService, crawlerService)
	gameShieldBackendService := service.NewGameShieldBackendService(serviceService, gameShieldBackendRepository, gameShieldRepository, crawlerService, gameShieldPublicIpService, duedateService, formatterService, parserService, requiredService, viperViper, gameShieldService, hostService)
	gameShieldBackendHandler := handler.NewGameShieldBackendHandler(handlerHandler, gameShieldBackendService)
	webForwardingRepository := repository.NewWebForwardingRepository(repositoryRepository)
	globalLimitRepository := repository.NewGlobalLimitRepository(repositoryRepository)
	tcpforwardingRepository := repository.NewTcpforwardingRepository(repositoryRepository)
	udpForWardingRepository := repository.NewUdpForWardingRepository(repositoryRepository)
	gatewayipRepository := repository.NewGatewayipRepository(repositoryRepository)
	requestService := service.NewRequestService(serviceService)
	cdnRepository := repository.NewCdnRepository(repositoryRepository)
	cdnService := service.NewCdnService(serviceService, viperViper, requestService, cdnRepository)
	wafFormatterService := service.NewWafFormatterService(serviceService, globalLimitRepository, hostRepository, requiredService, parserService, tcpforwardingRepository, udpForWardingRepository, webForwardingRepository, rabbitMQ, hostService, gatewayipRepository, cdnService)
	aoDunService := service.NewAoDunService(serviceService, viperViper)
	proxyRepository := repository.NewProxyRepository(repositoryRepository)
	proxyService := service.NewProxyService(serviceService, proxyRepository, cdnService)
	sslCertService := service.NewSslCertService(serviceService, webForwardingRepository, cdnService)
	websocketService := service.NewWebsocketService(serviceService, cdnService, webForwardingRepository)
	webForwardingService := service.NewWebForwardingService(serviceService, requiredService, webForwardingRepository, crawlerService, parserService, wafFormatterService, aoDunService, rabbitMQ, gatewayipRepository, globalLimitRepository, cdnService, proxyService, sslCertService, websocketService)
	webForwardingHandler := handler.NewWebForwardingHandler(handlerHandler, webForwardingService)
	tcpforwardingService := service.NewTcpforwardingService(serviceService, tcpforwardingRepository, parserService, requiredService, crawlerService, globalLimitRepository, hostRepository, wafFormatterService, cdnService, proxyService)
	tcpforwardingHandler := handler.NewTcpforwardingHandler(handlerHandler, tcpforwardingService)
	udpForWardingService := service.NewUdpForWardingService(serviceService, udpForWardingRepository, requiredService, parserService, crawlerService, globalLimitRepository, hostRepository, wafFormatterService, cdnService, proxyService)
	udpForWardingHandler := handler.NewUdpForWardingHandler(handlerHandler, udpForWardingService)
	allowAndDenyIpRepository := repository.NewAllowAndDenyIpRepository(repositoryRepository)
	allowAndDenyIpService := service.NewAllowAndDenyIpService(serviceService, allowAndDenyIpRepository, wafFormatterService, gatewayipRepository)
	globalLimitService := service.NewGlobalLimitService(serviceService, globalLimitRepository, duedateService, crawlerService, viperViper, requiredService, parserService, hostService, hostRepository, cdnService, cdnRepository, tcpforwardingRepository, udpForWardingRepository, webForwardingRepository, allowAndDenyIpService, allowAndDenyIpRepository, tcpforwardingService, udpForWardingService, webForwardingService, gatewayipRepository)
	globalLimitHandler := handler.NewGlobalLimitHandler(handlerHandler, globalLimitService)
	adminRepository := repository.NewAdminRepository(repositoryRepository)
	adminService := service.NewAdminService(serviceService, adminRepository)
	adminHandler := handler.NewAdminHandler(handlerHandler, adminService)
	gatewayGroupRepository := repository.NewGatewayGroupRepository(repositoryRepository)
	gatewayGroupService := service.NewGatewayGroupService(serviceService, gatewayGroupRepository, requiredService, parserService, requestService)
	gatewayGroupHandler := handler.NewGatewayGroupHandler(handlerHandler, gatewayGroupService)
	gateWayGroupIpRepository := repository.NewGateWayGroupIpRepository(repositoryRepository)
	gateWayGroupIpService := service.NewGateWayGroupIpService(serviceService, gateWayGroupIpRepository, gatewayGroupRepository, requestService)
	gateWayGroupIpHandler := handler.NewGateWayGroupIpHandler(handlerHandler, gateWayGroupIpService)
	allowAndDenyIpHandler := handler.NewAllowAndDenyIpHandler(handlerHandler, allowAndDenyIpService)
	ccRepository := repository.NewCcRepository(repositoryRepository)
	ccService := service.NewCcService(serviceService, ccRepository, webForwardingRepository, cdnService)
	ccHandler := handler.NewCcHandler(handlerHandler, ccService)
	logRepository := repository.NewLogRepository(repositoryRepository)
	logService := service.NewLogService(serviceService, logRepository)
	httpServer := server.NewHTTPServer(logger, viperViper, jwtJWT, syncedEnforcer, limiterLimiter, handlerFunc, userHandler, gameShieldHandler, gameShieldBackendHandler, webForwardingHandler, tcpforwardingHandler, udpForWardingHandler, globalLimitHandler, adminHandler, gatewayGroupHandler, gateWayGroupIpHandler, allowAndDenyIpHandler, ccHandler, logService)
	appApp := newApp(httpServer)
	return appApp, func() {
		cleanup()
	}, nil
}

// wire.go:

var repositorySet = wire.NewSet(repository.NewDB, repository.NewRedis, repository.NewCasbinEnforcer, repository.NewMongoClient, repository.NewMongoDB, repository.NewRabbitMQ, repository.NewRepository, repository.NewTransaction, repository.NewAdminRepository, repository.NewUserRepository, repository.NewGameShieldRepository, repository.NewGameShieldPublicIpRepository, repository.NewWebForwardingRepository, repository.NewTcpforwardingRepository, repository.NewUdpForWardingRepository, repository.NewGameShieldUserIpRepository, repository.NewGameShieldBackendRepository, repository.NewGameShieldSdkIpRepository, repository.NewHostRepository, repository.NewGlobalLimitRepository, repository.NewGatewayGroupRepository, repository.NewGateWayGroupIpRepository, repository.NewCdnRepository, repository.NewAllowAndDenyIpRepository, repository.NewProxyRepository, repository.NewCcRepository, repository.NewExpiredRepository, repository.NewLogRepository, repository.NewGatewayipRepository)

var serviceSet = wire.NewSet(service.NewService, service.NewUserService, service.NewAdminService, service.NewGameShieldService, service.NewAoDunService, service.NewGameShieldPublicIpService, service.NewDuedateService, service.NewFormatterService, service.NewParserService, service.NewRequiredService, service.NewCrawlerService, service.NewWebForwardingService, service.NewTcpforwardingService, service.NewUdpForWardingService, service.NewGameShieldUserIpService, service.NewGameShieldBackendService, service.NewGameShieldSdkIpService, service.NewHostService, service.NewGlobalLimitService, service.NewGatewayGroupService, service.NewWafFormatterService, service.NewGateWayGroupIpService, service.NewRequestService, service.NewCdnService, service.NewAllowAndDenyIpService, service.NewProxyService, service.NewSslCertService, service.NewWebsocketService, service.NewCcService, service.NewLogService, service.NewGatewayipService)

var handlerSet = wire.NewSet(handler.NewHandler, handler.NewUserHandler, handler.NewAdminHandler, handler.NewGameShieldHandler, handler.NewGameShieldPublicIpHandler, handler.NewWebForwardingHandler, handler.NewTcpforwardingHandler, handler.NewUdpForWardingHandler, handler.NewGameShieldUserIpHandler, handler.NewGameShieldBackendHandler, handler.NewGameShieldSdkIpHandler, handler.NewHostHandler, handler.NewGlobalLimitHandler, handler.NewGatewayGroupHandler, handler.NewGateWayGroupIpHandler, handler.NewAllowAndDenyIpHandler, handler.NewCcHandler, handler.NewGatewayipHandler)

// 限流器依赖集
var limiterSet = wire.NewSet(limiter.NewLimiter, middleware.NewRateLimitMiddleware)

var serverSet = wire.NewSet(server.NewHTTPServer)

// build App
func newApp(
	httpServer *http.Server,
) *app.App {
	return app.NewApp(app.WithServer(httpServer), app.WithName("demo-server"))
}
