代码拉取完成,页面将自动刷新
同步操作将从 baetyl/baetyl-cloud 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package main
import (
"runtime"
"github.com/baetyl/baetyl-go/v2/context"
"github.com/baetyl/baetyl-go/v2/log"
_ "github.com/go-sql-driver/mysql"
"github.com/baetyl/baetyl-cloud/v2/api"
"github.com/baetyl/baetyl-cloud/v2/common"
"github.com/baetyl/baetyl-cloud/v2/config"
"github.com/baetyl/baetyl-cloud/v2/plugin"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/awss3"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/database"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/decryption"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/default/auth"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/default/csrf"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/default/license"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/default/lock"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/default/pki"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/default/sign"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/default/task"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/default/transaction"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/kube"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/link/httplink"
_ "github.com/baetyl/baetyl-cloud/v2/plugin/sign"
"github.com/baetyl/baetyl-cloud/v2/server"
)
func main() {
defer plugin.ClosePlugins()
runtime.GOMAXPROCS(runtime.NumCPU())
context.Run(func(ctx context.Context) error {
var cfg config.CloudConfig
err := ctx.LoadCustomConfig(&cfg)
if err != nil {
return err
}
ctx.Log().Debug("cloud config", log.Any("cfg", cfg))
common.SetConfFile(ctx.ConfFile())
a, err := api.NewAPI(&cfg)
if err != nil {
return err
}
sa, err := api.NewSyncAPI(&cfg)
if err != nil {
return err
}
ia, err := api.NewInitAPI(&cfg)
if err != nil {
return err
}
s, err := server.NewAdminServer(&cfg)
if err != nil {
return err
}
s.SetAPI(a)
s.InitRoute()
go s.Run()
defer s.Close()
ctx.Log().Info("admin server starting")
ss, err := server.NewSyncServer(&cfg)
if err != nil {
return err
}
ss.SetSyncAPI(sa)
ss.InitMsgRouter()
ss.Run()
defer ss.Close()
as, err := server.NewInitServer(&cfg)
if err != nil {
return err
}
as.SetAPI(ia)
as.InitRoute()
go as.Run()
defer as.Close()
ctx.Log().Info("init server starting")
ctx.Wait()
return nil
})
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。