-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwire_gen.go
41 lines (35 loc) · 1.25 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
// Code generated by Wire. DO NOT EDIT.
//go:generate go run -mod=mod github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package main
import (
"awesome-shortLink/internal/repository"
"awesome-shortLink/internal/repository/cache"
"awesome-shortLink/internal/repository/dao"
"awesome-shortLink/internal/repository/filter"
"awesome-shortLink/internal/service"
"awesome-shortLink/internal/web"
"awesome-shortLink/ioc"
"github.com/gin-gonic/gin"
)
// Injectors from wire.go:
func InitShortLinkHdl() *web.ShortLinkHandler {
db := ioc.InitDB()
shortLinkDAO := dao.NewShortLinkDAOV1(db)
logger := ioc.InitZap()
cmdable := ioc.InitRedis()
shortLinkCache := cache.NewShortLinkRedisV1(cmdable)
bloomFilter := filter.NewBloomFilterV1(cmdable)
node := ioc.InitSnowFlakeNode()
shortLinkRepository := repository.NewShortLinkRepositoryV3(shortLinkDAO, logger, shortLinkCache, bloomFilter, node)
shortLinkService := service.NewShortLinkServiceBasic(shortLinkRepository, logger)
shortLinkHandler := web.NewShortLinkHandler(shortLinkService, logger)
return shortLinkHandler
}
func InitWebServer() *gin.Engine {
shortLinkHandler := InitShortLinkHdl()
v := ioc.InitMiddleWare()
engine := ioc.InitGinEngine(shortLinkHandler, v...)
return engine
}