// initApp init kratos application.
initApp init kratos application.
// initApp init kratos application .
func initApp(confServer *conf.Server, confData *conf.Data, logger log.Logger) (*kratos.App, func(), error) {
	dataData, cleanup, err := data.NewData(confData, logger)
	if err != nil {
		return nil, nil, err
	}
	sweetRepo := data.NewSweetRepo(dataData, logger)
	sweetUsecase := biz.NewSweetUsecase(sweetRepo, logger)
	sweetService := service.NewSweetService(sweetUsecase, logger)
	httpServer := server.NewHTTPServer(confServer, sweetService, logger)
	grpcServer := server.NewGRPCServer(confServer, sweetService, logger)
	instance := autowire.NewInstance(dataData, sweetUsecase)
	app := newApp(logger, httpServer, grpcServer,instance)
	return app, func() {
		cleanup()
	}, nil
}
func initApp ( confServer * conf . Server , confData * conf . Data , logger log . Logger ) ( * kratos . App , func ( ) , error ) { dataData , cleanup , err := data . NewData ( confData , logger ) if err != nil { return nil , nil , err } sweetRepo := data . NewSweetRepo ( dataData , logger ) sweetUsecase := biz . NewSweetUsecase ( sweetRepo , logger ) sweetService := service . NewSweetService ( sweetUsecase , logger ) httpServer := server . NewHTTPServer ( confServer , sweetService , logger ) grpcServer := server . NewGRPCServer ( confServer , sweetService , logger ) instance := autowire . NewInstance ( dataData , sweetUsecase ) app := newApp ( logger , httpServer , grpcServer , instance ) return app , func ( ) { cleanup ( ) } , nil }
initApp init kratos application.
initApp init kratos application .