2022-09-10 00:09:09 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2022-09-21 22:55:52 +02:00
|
|
|
"git.front.kjuulh.io/kjuulh/octopush/cmd/server/commands"
|
|
|
|
"git.front.kjuulh.io/kjuulh/octopush/internal/logger"
|
2022-09-10 00:09:09 +02:00
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
logger, err := logger.New()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
_ = logger.Sync()
|
|
|
|
|
2022-09-18 16:49:34 +02:00
|
|
|
zap.ReplaceGlobals(logger)
|
|
|
|
|
2022-09-10 00:09:09 +02:00
|
|
|
Execute(logger)
|
|
|
|
}
|
|
|
|
|
|
|
|
func Execute(logger *zap.Logger) {
|
|
|
|
err := commands.CreateServerCmd(logger).Execute()
|
|
|
|
if err != nil {
|
|
|
|
logger.Error("execution failed", zap.Error(err))
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|