1234567891011121314151617181920212223242526272829303132333435363738 |
- package global
- import (
- "context"
- _ "unsafe"
- "github.com/robfig/cron/v3"
- )
- var (
- webServer WebServer
- subServer SubServer
- )
- type WebServer interface {
- GetCron() *cron.Cron
- GetCtx() context.Context
- }
- type SubServer interface {
- GetCtx() context.Context
- }
- func SetWebServer(s WebServer) {
- webServer = s
- }
- func GetWebServer() WebServer {
- return webServer
- }
- func SetSubServer(s SubServer) {
- subServer = s
- }
- func GetSubServer() SubServer {
- return subServer
- }
|