-
Notifications
You must be signed in to change notification settings - Fork 4
/
wire.go
62 lines (56 loc) · 1.68 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
58
59
60
61
62
//go:build wireinject
// +build wireinject
package main
import (
"github.com/google/wire"
"github.com/traPtitech/anke-to/model"
"github.com/traPtitech/anke-to/router"
"github.com/traPtitech/anke-to/traq"
)
var (
administratorBind = wire.Bind(new(model.IAdministrator), new(*model.Administrator))
optionBind = wire.Bind(new(model.IOption), new(*model.Option))
questionnaireBind = wire.Bind(new(model.IQuestionnaire), new(*model.Questionnaire))
questionBind = wire.Bind(new(model.IQuestion), new(*model.Question))
respondentBind = wire.Bind(new(model.IRespondent), new(*model.Respondent))
responseBind = wire.Bind(new(model.IResponse), new(*model.Response))
scaleLabelBind = wire.Bind(new(model.IScaleLabel), new(*model.ScaleLabel))
targetBind = wire.Bind(new(model.ITarget), new(*model.Target))
validationBind = wire.Bind(new(model.IValidation), new(*model.Validation))
transactionBind = wire.Bind(new(model.ITransaction), new(*model.Transaction))
webhookBind = wire.Bind(new(traq.IWebhook), new(*traq.Webhook))
)
func InjectAPIServer() *router.API {
wire.Build(
router.NewAPI,
router.NewMiddleware,
router.NewQuestionnaire,
router.NewQuestion,
router.NewResponse,
router.NewResult,
router.NewUser,
model.NewAdministrator,
model.NewOption,
model.NewQuestionnaire,
model.NewQuestion,
model.NewRespondent,
model.NewResponse,
model.NewScaleLabel,
model.NewTarget,
model.NewValidation,
model.NewTransaction,
traq.NewWebhook,
administratorBind,
optionBind,
questionnaireBind,
questionBind,
respondentBind,
responseBind,
scaleLabelBind,
targetBind,
validationBind,
transactionBind,
webhookBind,
)
return nil
}