httpserver

package
v0.0.0-...-a18962b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthStatus

type HealthStatus struct {
	Status  string          `json:"status"`
	Checks  map[string]bool `json:"checks"`
	Version string          `json:"version"`
	Uptime  string          `json:"uptime"`
}

HealthStatus represents the health status of the application

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents a unified HTTP server that consolidates health, webhook, and metrics endpoints

func New

func New(port int) *Server

New creates a new unified HTTP server on the specified port

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the server address for logging purposes

func (*Server) RegisterHealth

func (s *Server) RegisterHealth()

RegisterHealth registers the /health endpoint

func (*Server) RegisterMetrics

func (s *Server) RegisterMetrics()

RegisterMetrics registers the /metrics endpoint for Prometheus

func (*Server) RegisterPPROF

func (s *Server) RegisterPPROF()

RegisterPPROF registers pprof endpoints for performance profiling. This should only be enabled in development environments.

func (*Server) RegisterWebhook

func (s *Server) RegisterWebhook(bot *gotgbot.Bot, dispatcher *ext.Dispatcher, secret, domain string) error

RegisterWebhook registers the webhook endpoint and configures the Telegram webhook

func (*Server) Start

func (s *Server) Start() error

Start starts the unified HTTP server

func (*Server) Stop

func (s *Server) Stop() error

Stop gracefully stops the HTTP server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL