Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2025-09-20 10:35:50 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2025-09-20 10:35:50 +0300
commit6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 (patch)
tree28d8d82530476cf607e4d05ca189ae05868711e6 /web/job/stats_notify_job.go
parentf60682a6b7cb749fee403c84e2587c3ad7e7ced0 (diff)
docs: add comments for all functions
Diffstat (limited to 'web/job/stats_notify_job.go')
-rw-r--r--web/job/stats_notify_job.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/web/job/stats_notify_job.go b/web/job/stats_notify_job.go
index 0d0907e0..b93f05cb 100644
--- a/web/job/stats_notify_job.go
+++ b/web/job/stats_notify_job.go
@@ -4,23 +4,26 @@ import (
"github.com/mhsanaei/3x-ui/v2/web/service"
)
+// LoginStatus represents the status of a login attempt.
type LoginStatus byte
const (
- LoginSuccess LoginStatus = 1
- LoginFail LoginStatus = 0
+ LoginSuccess LoginStatus = 1 // Successful login
+ LoginFail LoginStatus = 0 // Failed login attempt
)
+// StatsNotifyJob sends periodic statistics reports via Telegram bot.
type StatsNotifyJob struct {
xrayService service.XrayService
tgbotService service.Tgbot
}
+// NewStatsNotifyJob creates a new statistics notification job instance.
func NewStatsNotifyJob() *StatsNotifyJob {
return new(StatsNotifyJob)
}
-// Here run is a interface method of Job interface
+// Run sends a statistics report via Telegram bot if Xray is running.
func (j *StatsNotifyJob) Run() {
if !j.xrayService.IsXrayRunning() {
return