-
Notifications
You must be signed in to change notification settings - Fork 0
/
wire_gen.go
50 lines (44 loc) · 1.26 KB
/
wire_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package di
import (
"github.com/gin-gonic/gin"
"github.com/gsxhnd/go-api-template/src/dao"
"github.com/gsxhnd/go-api-template/src/handler"
"github.com/gsxhnd/go-api-template/src/middleware"
"github.com/gsxhnd/go-api-template/src/routes"
"github.com/gsxhnd/go-api-template/src/service"
"github.com/gsxhnd/go-api-template/src/utils"
)
// Injectors from wire.go:
func InitApp() (*Application, error) {
engine := gin.New()
config, err := utils.NewConfig()
if err != nil {
return nil, err
}
logger := utils.NewLogger(config)
tracer, err := utils.NewTracer(config)
if err != nil {
return nil, err
}
middlewarer := middleware.NewMiddleware(logger, tracer)
rootHandler := handler.NewRootHandle(logger)
database := dao.NewDatabase(logger)
demoService := service.NewDemoService(logger, database)
demoHandler := handler.NewDemoHandle(logger, demoService)
routesRoutes := &routes.Routes{
Engine: engine,
Middleware: middlewarer,
RootHandle: rootHandler,
DemoHandle: demoHandler,
}
application := NewApplication(routesRoutes)
return application, nil
}
func InitTask() (*Task, error) {
task := NewTask()
return task, nil
}