Add comprehensive godoc documentation to handler.go

Expand documentation comments for SimpleHandler type and its methods
to better explain their purpose, parameters, and behavior.
This commit is contained in:
2025-12-27 12:24:36 +07:00
parent e1d0ab5ea6
commit c292fef0ac
7 changed files with 52 additions and 19 deletions

View File

@@ -57,7 +57,8 @@ func writeJSONSuccess(w http.ResponseWriter, data interface{}) error {
})
}
// handleStatusJSON returns a handler that serves JSON statistics
// handleStatusJSON returns a handler that serves JSON statistics including
// uptime, message counts, database stats, and route information.
func (s *Server) handleStatusJSON() http.HandlerFunc {
// Stats represents the statistics response
type Stats struct {
@@ -177,7 +178,8 @@ func (s *Server) handleStatusJSON() http.HandlerFunc {
}
}
// handleStats returns a handler that serves API v1 statistics
// handleStats returns a handler that serves API v1 statistics including
// detailed handler queue statistics and performance metrics.
func (s *Server) handleStats() http.HandlerFunc {
// HandlerStatsInfo represents handler statistics in the API response
type HandlerStatsInfo struct {
@@ -338,7 +340,8 @@ func (s *Server) handleStats() http.HandlerFunc {
}
}
// handleStatusHTML returns a handler that serves the HTML status page
// handleStatusHTML returns a handler that serves the HTML status page,
// which displays real-time statistics fetched via JavaScript.
func (s *Server) handleStatusHTML() http.HandlerFunc {
return func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")