From 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Sat, 20 Sep 2025 09:35:50 +0200 Subject: docs: add comments for all functions --- web/service/server.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'web/service/server.go') diff --git a/web/service/server.go b/web/service/server.go index 03199b50..9fe42e2c 100644 --- a/web/service/server.go +++ b/web/service/server.go @@ -35,14 +35,18 @@ import ( "github.com/shirou/gopsutil/v4/net" ) +// ProcessState represents the current state of a system process. type ProcessState string +// Process state constants const ( - Running ProcessState = "running" - Stop ProcessState = "stop" - Error ProcessState = "error" + Running ProcessState = "running" // Process is running normally + Stop ProcessState = "stop" // Process is stopped + Error ProcessState = "error" // Process is in error state ) +// Status represents comprehensive system and application status information. +// It includes CPU, memory, disk, network statistics, and Xray process status. type Status struct { T time.Time `json:"-"` Cpu float64 `json:"cpu"` @@ -89,10 +93,13 @@ type Status struct { } `json:"appStats"` } +// Release represents information about a software release from GitHub. type Release struct { - TagName string `json:"tag_name"` + TagName string `json:"tag_name"` // The tag name of the release } +// ServerService provides business logic for server monitoring and management. +// It handles system status collection, IP detection, and application statistics. type ServerService struct { xrayService XrayService inboundService InboundService -- cgit v1.2.3