-
Notifications
You must be signed in to change notification settings - Fork 0
/
wire_gen.go
43 lines (35 loc) · 1.07 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
// Code generated by Wire. DO NOT EDIT.
//go:generate wire
//+build !wireinject
package main
import (
"context"
"github.com/jmoiron/sqlx"
"github.com/miya-masa/go-clean-webapp/interface/database"
"github.com/miya-masa/go-clean-webapp/interface/presenter"
"github.com/miya-masa/go-clean-webapp/usecase"
"github.com/miya-masa/go-clean-webapp/web"
)
import (
_ "github.com/lib/pq"
)
// Injectors from injector.go:
func setupApplication(ctx context.Context) (Application, error) {
sqlxDB, err := db(ctx)
if err != nil {
return Application{}, err
}
accountRepository := database.NewAccount(sqlxDB)
accountInputPort := usecase.NewAccountInteractor(accountRepository)
accountPresenter := &presenter.AccountPresenter{}
accountHandler := web.NewAccountHandler(accountInputPort, accountPresenter)
application, err := newApplication(ctx, accountHandler)
if err != nil {
return Application{}, err
}
return application, nil
}
// injector.go:
func db(ctx context.Context) (*sqlx.DB, error) {
return sqlx.Connect("postgres", "user=miya password=miya dbname=miya sslmode=disable")
}