-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
39 lines (31 loc) · 1.24 KB
/
main.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
package main
import (
"musical_wiki/config"
"musical_wiki/handlers"
"musical_wiki/initialize"
"musical_wiki/repository"
"musical_wiki/router"
"musical_wiki/service"
"musical_wiki/utils"
)
func main() {
logger := initialize.NewLogger()
redis := initialize.NewRedis(logger)
db := initialize.NewDB(config.NewPg(), logger)
s3 := initialize.NewS3(logger)
translator := initialize.NewTranslator(logger)
uploader := utils.NewUploader(s3, logger)
cache := utils.NewCache(redis, logger)
baseHandler := handlers.NewBaseHandler(logger, translator)
creditRepository := repository.NewCreditRepository(db)
creditService := service.NewCreditService(creditRepository, logger, cache)
creditHandler := handlers.NewCreditHandler(baseHandler, creditService)
imageRepository := repository.NewImageRepository(db)
imageService := service.NewImageService(imageRepository, logger, uploader, cache)
imageHandler := handlers.NewImageHandler(baseHandler, imageService)
actorRepository := repository.NewActorRepository(db)
actorService := service.NewActorService(actorRepository, logger, cache, creditService, imageService)
actorHandler := handlers.NewActorHandler(baseHandler, actorService)
r := router.NewRouter(actorHandler, creditHandler, imageHandler)
r.Run()
}