Documentation
¶
Index ¶
- Constants
- Variables
- func AuthAfterFunc(r *ghttp.Request, respData gtoken.Resp)
- func CheckFile()
- func GetGtoken(ctx context.Context) (gfToken *gtoken.GfToken, err error)
- func JobInit()
- func LiveMonitor()
- func LoginFunc(r *ghttp.Request) (string, any)
- func LogoutAfterFunc(r *ghttp.Request, respData gtoken.Resp)
- func Migrate() (err error)
Constants ¶
View Source
const ( DB_URL = "sqlite3://resources/data/gowlive.db" SOURCE_URL = "file://manifest/migrate" )
Variables ¶
View Source
var ( Main = gcmd.Command{ Name: "main", Usage: "main", Brief: "Gowlive backend api", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { g.Log().Info(ctx, "Starting HTTP Server...") gfToken, err := GetGtoken(ctx) if err != nil { g.Log().Error(ctx, err) return err } initDir() s := g.Server() s.SetGraceful(true) s.SetIndexFolder(true) s.SetServerRoot(utils.DATA_PATH) s.AddSearchPath(utils.DATA_PATH) s.SetSwaggerUITemplate(consts.MySwaggerUITemplate) s.Use(service.Middleware().HandlerResponse) s.Group("/", func(group *ghttp.RouterGroup) { group.Middleware( service.Middleware().Ctx, ghttp.MiddlewareCORS, ) group.Group("/", func(group *ghttp.RouterGroup) { err = gfToken.Middleware(ctx, group) if err != nil { panic(err) } group.ALL("/sse", sse.HandleSSE) bindRoute(group) }) }) if err = s.Start(); err != nil { g.Log().Errorf(ctx, "server 启动异常,错误信息:%v", err) return err } initHandler() initProxyRegistry(ctx) initCookieRegistry(ctx) g.Go(ctx, func(c context.Context) { time.Sleep(1500 * time.Millisecond) CheckFile() JobInit() LiveMonitor() }, func(c context.Context, err error) { g.Log().Errorf(c, "starter 启动异常,错误信息:%v", err) }) gproc.AddSigHandlerShutdown(shutdown) gproc.Listen() return nil }, } )
Functions ¶
func LiveMonitor ¶
func LiveMonitor()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.