// Code generated by Wire. DO NOT EDIT.

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

package main

import (
	"galileo/app/engine/internal/biz"
	"galileo/app/engine/internal/conf"
	"galileo/app/engine/internal/data"
	"galileo/app/engine/internal/server"
	"galileo/app/engine/internal/service"
	"github.com/go-kratos/kratos/v2"
	"github.com/go-kratos/kratos/v2/log"
)

import (
	_ "go.uber.org/automaxprocs"
)

// Injectors from wire.go:

// wireApp init kratos application.
func wireApp(confServer *conf.Server, confData *conf.Data, confService *conf.Service, registry *conf.Registry, logger log.Logger) (*kratos.App, func(), error) {
	client, err := data.NewEntDB(confData)
	if err != nil {
		return nil, nil, err
	}
	redisClient := data.NewRedis(confData, logger)
	discovery := data.NewDiscovery(registry)
	managementClient := data.NewTaskServiceClient(confService, discovery)
	clientClient := data.NewDockerClient(confService, logger)
	asynqServer := server.NewAsynqServer(confData, logger)
	dataData, cleanup, err := data.NewData(confData, client, logger, redisClient, managementClient, clientClient, asynqServer)
	if err != nil {
		return nil, nil, err
	}
	schedulerRepo := data.NewEngineRepo(dataData, logger)
	schedulerUseCase := biz.NewEngineUseCase(schedulerRepo, logger)
	dockerRepo := data.NewDockerRepo(dataData, logger)
	dockerUseCase := biz.NewDockerUseCase(dockerRepo, logger)
	engineService := service.NewEngineService(schedulerUseCase, dockerUseCase, logger)
	grpcServer := server.NewGRPCServer(confServer, engineService, logger)
	registrar := data.NewRegistrar(registry)
	app := newApp(logger, grpcServer, asynqServer, registrar)
	return app, func() {
		cleanup()
	}, nil
}
