api

package
v0.0.0-...-ee0cddb Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HTTPPort  int
	GRPCAddr  string
	AuthToken string
}

Config holds the HTTP server configuration.

type Server

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

Server represents the HTTP API gateway server.

func NewServer

func NewServer(cfg *Config, logger *pkg.Logger) (*Server, error)

NewServer creates a new HTTP API gateway server.

func (*Server) GetWebSocketHub

func (s *Server) GetWebSocketHub() *WebSocketHub

GetWebSocketHub returns the WebSocket hub for broadcasting updates.

func (*Server) Start

func (s *Server) Start(port int) error

Start starts the HTTP server.

func (*Server) Stop

func (s *Server) Stop() error

Stop gracefully stops the HTTP server.

type WebSocketHub

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

WebSocketHub manages WebSocket connections for live updates.

func NewWebSocketHub

func NewWebSocketHub(logger *pkg.Logger) *WebSocketHub

NewWebSocketHub creates a new WebSocket hub.

func (*WebSocketHub) BroadcastRingUpdate

func (h *WebSocketHub) BroadcastRingUpdate(update interface{}) error

BroadcastRingUpdate sends a ring update to all connected clients.

func (*WebSocketHub) HandleWebSocket

func (h *WebSocketHub) HandleWebSocket(w http.ResponseWriter, r *http.Request)

HandleWebSocket handles WebSocket connections.

func (*WebSocketHub) Run

func (h *WebSocketHub) Run()

Run starts the WebSocket hub.

func (*WebSocketHub) Stop

func (h *WebSocketHub) Stop()

Stop gracefully shuts down the WebSocket hub.

Jump to

Keyboard shortcuts

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