-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwire.go
57 lines (49 loc) · 1.33 KB
/
wire.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
51
52
53
54
55
56
57
//go:build wireinject
// +build wireinject
// https://github.com/golang/vscode-go/issues/2075
package main
import (
"github.com/arikama/koran-backend/daos"
"github.com/arikama/koran-backend/favorite"
"github.com/arikama/koran-backend/managers"
"github.com/arikama/koran-backend/services"
"github.com/google/wire"
)
func wireUserDaoImpl() (*daos.UserDaoImpl, error) {
wire.Build(daos.NewUserDaoImpl, NewDb)
return nil, nil
}
func wireGoogleAuthServiceImpl() (*services.GoogleAuthServiceImpl, error) {
wire.Build(
services.NewGoogleAuthServiceImpl,
)
return nil, nil
}
func wireQuranManagerImpl(csvDir string) (*managers.QuranManagerImpl, error) {
wire.Build(managers.NewQuranManagerImpl)
return nil, nil
}
func wireUserManagerImpl() (*managers.UserManagerImpl, error) {
wire.Build(
managers.NewUserManagerImpl,
wire.Bind(new(daos.UserDao), new(*daos.UserDaoImpl)),
daos.NewUserDaoImpl,
NewDb,
)
return nil, nil
}
func wireFavDaoImpl() (*favorite.FavDaoImpl, error) {
wire.Build(favorite.NewFavDaoImpl, NewDb)
return nil, nil
}
func wireFavManagerImpl() (*favorite.FavManagerImpl, error) {
wire.Build(
wire.Bind(new(daos.UserDao), new(*daos.UserDaoImpl)),
wire.Bind(new(favorite.FavDao), new(*favorite.FavDaoImpl)),
favorite.NewFavManagerImpl,
daos.NewUserDaoImpl,
favorite.NewFavDaoImpl,
NewDb,
)
return nil, nil
}