|
1
|
|
|
//go:build wireinject |
|
2
|
|
|
// +build wireinject |
|
3
|
|
|
|
|
4
|
|
|
package internal |
|
5
|
|
|
|
|
6
|
|
|
import ( |
|
7
|
|
|
"github.com/google/wire" |
|
8
|
|
|
"github.com/memnix/memnix-rest/app/http/controllers" |
|
9
|
|
|
"github.com/memnix/memnix-rest/app/meilisearch" |
|
10
|
|
|
"github.com/memnix/memnix-rest/infrastructures" |
|
11
|
|
|
"github.com/memnix/memnix-rest/internal/auth" |
|
12
|
|
|
"github.com/memnix/memnix-rest/internal/deck" |
|
13
|
|
|
"github.com/memnix/memnix-rest/internal/user" |
|
14
|
|
|
) |
|
15
|
|
|
|
|
16
|
|
|
func InitializeUser() controllers.UserController { |
|
17
|
|
|
wire.Build(controllers.NewUserController, user.NewUseCase, user.NewRedisRepository, infrastructures.GetRedisClient, user.NewRepository, infrastructures.GetDBConn) |
|
18
|
|
|
return controllers.UserController{} |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
func InitializeAuth() controllers.AuthController { |
|
22
|
|
|
wire.Build(controllers.NewAuthController, auth.NewUseCase, user.NewRepository, infrastructures.GetDBConn) |
|
23
|
|
|
return controllers.AuthController{} |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
func InitializeJWT() controllers.JwtController { |
|
27
|
|
|
wire.Build(controllers.NewJwtController, user.NewUseCase, user.NewRedisRepository, infrastructures.GetRedisClient, user.NewRepository, infrastructures.GetDBConn) |
|
28
|
|
|
return controllers.JwtController{} |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
func InitializeOAuth() controllers.OAuthController { |
|
32
|
|
|
wire.Build(controllers.NewOAuthController, auth.NewUseCase, user.NewRepository, infrastructures.GetDBConn, auth.NewRedisRepository, infrastructures.GetRedisClient) |
|
33
|
|
|
return controllers.OAuthController{} |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
func InitializeDeck() controllers.DeckController { |
|
37
|
|
|
wire.Build(controllers.NewDeckController, deck.NewUseCase, deck.NewRepository, infrastructures.GetDBConn, deck.NewRedisRepository, infrastructures.GetRedisClient) |
|
38
|
|
|
return controllers.DeckController{} |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
func InitializeMeiliSearch() meilisearch.MeiliSearch { |
|
42
|
|
|
wire.Build(meilisearch.NewMeiliSearch, deck.NewUseCase, deck.NewRepository, infrastructures.GetDBConn, deck.NewRedisRepository, infrastructures.GetRedisClient) |
|
43
|
|
|
return meilisearch.MeiliSearch{} |
|
44
|
|
|
} |
|
45
|
|
|
|