-
Notifications
You must be signed in to change notification settings - Fork 0
/
wire_gen.go
40 lines (32 loc) · 1.3 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
// 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/go-playground/validator"
"github.com/google/wire"
"github.com/milhamap/simple-note/app"
"github.com/milhamap/simple-note/controller"
"github.com/milhamap/simple-note/middleware"
"github.com/milhamap/simple-note/repository"
"github.com/milhamap/simple-note/service"
"net/http"
)
import (
_ "github.com/go-sql-driver/mysql"
)
// Injectors from injector.go:
func InitializedServer() *http.Server {
noteRepository := repository.NewNoteRepository()
db := app.NewDB()
validate := validator.New()
noteService := service.NewNoteService(noteRepository, db, validate)
noteController := controller.NewNoteController(noteService)
router := app.NewRouter(noteController)
authMiddleware := middleware.NewAuthMiddleware(router)
server := app.NewServer(authMiddleware)
return server
}
// injector.go:
var noteSet = wire.NewSet(repository.NewNoteRepository, wire.Bind(new(repository.NoteRepositoryInterface), new(*repository.NoteRepository)), service.NewNoteService, wire.Bind(new(service.NoteServiceInterface), new(*service.NoteService)), controller.NewNoteController, wire.Bind(new(controller.NoteControllerInterface), new(*controller.NoteController)))