diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
| commit | 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 (patch) | |
| tree | 28d8d82530476cf607e4d05ca189ae05868711e6 /web/global/global.go | |
| parent | f60682a6b7cb749fee403c84e2587c3ad7e7ced0 (diff) | |
docs: add comments for all functions
Diffstat (limited to 'web/global/global.go')
| -rw-r--r-- | web/global/global.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/web/global/global.go b/web/global/global.go index e92c375b..025fa081 100644 --- a/web/global/global.go +++ b/web/global/global.go @@ -1,3 +1,4 @@ +// Package global provides global variables and interfaces for accessing web and subscription servers. package global import ( @@ -12,27 +13,33 @@ var ( subServer SubServer ) +// WebServer interface defines methods for accessing the web server instance. type WebServer interface { - GetCron() *cron.Cron - GetCtx() context.Context + GetCron() *cron.Cron // Get the cron scheduler + GetCtx() context.Context // Get the server context } +// SubServer interface defines methods for accessing the subscription server instance. type SubServer interface { - GetCtx() context.Context + GetCtx() context.Context // Get the server context } +// SetWebServer sets the global web server instance. func SetWebServer(s WebServer) { webServer = s } +// GetWebServer returns the global web server instance. func GetWebServer() WebServer { return webServer } +// SetSubServer sets the global subscription server instance. func SetSubServer(s SubServer) { subServer = s } +// GetSubServer returns the global subscription server instance. func GetSubServer() SubServer { return subServer } |
