You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kratos/tool/kratos-gen-project/templates/grpc/internal/di/wire.go.tmpl

21 lines
594 B

// +build wireinject
// The build tag makes sure the stub is not built in the final build.
package di
import (
pb "{{.ModPrefix}}{{.Name}}/api"
"{{.ModPrefix}}{{.Name}}/internal/dao"
"{{.ModPrefix}}{{.Name}}/internal/server/grpc"
"{{.ModPrefix}}{{.Name}}/internal/service"
"github.com/google/wire"
)
var daoProvider = wire.NewSet(dao.New, dao.NewDB, dao.NewRedis, dao.NewMC)
var serviceProvider = wire.NewSet(service.New, wire.Bind(new(pb.DemoServer), new(*service.Service)))
func InitApp() (*App, func(), error) {
panic(wire.Build(daoProvider, serviceProvider, grpc.New, NewApp))
}