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.
22 lines
652 B
22 lines
652 B
5 years ago
|
// +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/server/http"
|
||
|
"{{.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, http.New, grpc.New, NewApp))
|
||
|
}
|