-
Notifications
You must be signed in to change notification settings - Fork 0
/
wire_gen.go
41 lines (32 loc) · 1.67 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
// 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 (
"github.com/gin-gonic/gin"
"github.com/go-playground/validator"
"github.com/google/wire"
"peken-be/app"
"peken-be/controller"
"peken-be/helper"
"peken-be/repository"
"peken-be/service"
)
// Injectors from injector.go:
func InitializedServer() *gin.Engine {
db := app.ConnectToDb()
userRepositoryImpl := repository.NewUserRepository(db)
passwordUtilsImpl := helper.NewPasswordUtils()
validate := validator.New()
userServiceImpl := service.NewUserService(userRepositoryImpl, passwordUtilsImpl, validate)
userControllerImpl := controller.NewUserController(userServiceImpl)
loginServiceImpl := service.NewLoginService(userRepositoryImpl, passwordUtilsImpl, validate)
loginControllerImpl := controller.NewLoginController(loginServiceImpl)
engine := app.InitRoute(userControllerImpl, loginControllerImpl)
return engine
}
// injector.go:
var userSet = wire.NewSet(repository.NewUserRepository, wire.Bind(new(repository.UserRepository), new(*repository.UserRepositoryImpl)), service.NewUserService, wire.Bind(new(service.UserService), new(*service.UserServiceImpl)), controller.NewUserController, wire.Bind(new(controller.UserController), new(*controller.UserControllerImpl)))
var loginSet = wire.NewSet(service.NewLoginService, wire.Bind(new(service.LoginService), new(*service.LoginServiceImpl)), controller.NewLoginController, wire.Bind(new(controller.LoginController), new(*controller.LoginControllerImpl)))
var passGenSet = wire.NewSet(helper.NewPasswordUtils, wire.Bind(new(helper.PasswordUtils), new(*helper.PasswordUtilsImpl)))