init
This commit is contained in:
28
cmd/api/main.go
Normal file
28
cmd/api/main.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"rockhu-bot/local/api"
|
||||
"rockhu-bot/local/utl/db"
|
||||
discordrhu "rockhu-bot/local/utl/discord"
|
||||
"rockhu-bot/local/utl/server"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/robfig/cron/v3"
|
||||
|
||||
"go.uber.org/dig"
|
||||
)
|
||||
|
||||
func main() {
|
||||
godotenv.Load()
|
||||
di := dig.New()
|
||||
|
||||
c := cron.New()
|
||||
di.Provide(func() *cron.Cron {
|
||||
return c
|
||||
})
|
||||
|
||||
discordrhu.Init(di)
|
||||
db.Start(di)
|
||||
server := server.Start(di)
|
||||
api.Init(di, server)
|
||||
}
|
||||
Reference in New Issue
Block a user