Documentation
¶
Overview ¶
Package api provides WebSocket hub and client types for real-time dashboard communication.
Index ¶
- type Client
- type Gateway
- type Handlers
- func (h *Handlers) HandleCreateRoute(ctx forge.Context) error
- func (h *Handlers) HandleDebugDiscovery(ctx forge.Context) error
- func (h *Handlers) HandleDeleteRoute(ctx forge.Context) error
- func (h *Handlers) HandleDeregisterService(ctx forge.Context) error
- func (h *Handlers) HandleDisableRoute(ctx forge.Context) error
- func (h *Handlers) HandleEnableRoute(ctx forge.Context) error
- func (h *Handlers) HandleFARPDeregister(ctx forge.Context) error
- func (h *Handlers) HandleFARPHeartbeat(ctx forge.Context) error
- func (h *Handlers) HandleFARPRegister(ctx forge.Context) error
- func (h *Handlers) HandleGetConfig(ctx forge.Context) error
- func (h *Handlers) HandleGetRoute(ctx forge.Context) error
- func (h *Handlers) HandleGetRouteStats(ctx forge.Context) error
- func (h *Handlers) HandleGetStats(ctx forge.Context) error
- func (h *Handlers) HandleListDiscoveredServices(ctx forge.Context) error
- func (h *Handlers) HandleListRoutes(ctx forge.Context) error
- func (h *Handlers) HandleListUpstreams(ctx forge.Context) error
- func (h *Handlers) HandleRefreshDiscovery(ctx forge.Context) error
- func (h *Handlers) HandleRegisterService(ctx forge.Context) error
- func (h *Handlers) HandleUpdateRoute(ctx forge.Context) error
- func (h *Handlers) HandleWebSocket(ctx forge.Context) error
- type Hub
- type WSMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleman between the websocket connection and the hub.
type Gateway ¶
type Gateway interface {
Config() bastion.Config
RouteManager() bastion.RouteRegistry
HealthMonitor() *health.Monitor
Snapshot() *bastion.GatewayStats
AccessLog() *observability.AccessLogger
Discovery() *bastion.ServiceDiscovery
Logger() forge.Logger
Hub() bastion.WSBroadcaster
}
Gateway provides the admin API with access to gateway components.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers provides REST API handlers for the gateway admin.
func NewHandlers ¶
NewHandlers creates new admin API handlers.
func (*Handlers) HandleCreateRoute ¶
HandleCreateRoute creates a new manual route.
func (*Handlers) HandleDebugDiscovery ¶
HandleDebugDiscovery performs a one-shot discovery probe and returns raw results for diagnosing mDNS/service discovery issues.
func (*Handlers) HandleDeleteRoute ¶
HandleDeleteRoute deletes a manual route.
func (*Handlers) HandleDeregisterService ¶
HandleDeregisterService removes a pushed service and its routes.
func (*Handlers) HandleDisableRoute ¶
HandleDisableRoute disables a route.
func (*Handlers) HandleEnableRoute ¶
HandleEnableRoute enables a route.
func (*Handlers) HandleFARPDeregister ¶
HandleFARPDeregister handles FARP v1 deregistration. DELETE /_farp/v1/deregister/:id
func (*Handlers) HandleFARPHeartbeat ¶
HandleFARPHeartbeat handles FARP v1 heartbeat protocol. PUT /_farp/v1/heartbeat/:id
Returns the gateway's known routes_checksum so the service SDK can detect mismatches and trigger re-registration for reconciliation.
func (*Handlers) HandleFARPRegister ¶
HandleFARPRegister handles the FARP v1 push registration protocol. POST /_farp/v1/register — accepts {instance: {...}, manifest?: {...}} The gateway fetches the full manifest from the service's /_farp/manifest endpoint if not included in the payload.
func (*Handlers) HandleGetConfig ¶
HandleGetConfig returns the current gateway configuration.
func (*Handlers) HandleGetRoute ¶
HandleGetRoute returns a single route by ID.
func (*Handlers) HandleGetRouteStats ¶
HandleGetRouteStats returns per-route statistics.
func (*Handlers) HandleGetStats ¶
HandleGetStats returns aggregated gateway statistics.
func (*Handlers) HandleListDiscoveredServices ¶
HandleListDiscoveredServices returns all discovered services.
func (*Handlers) HandleListRoutes ¶
HandleListRoutes returns all routes.
func (*Handlers) HandleListUpstreams ¶
HandleListUpstreams returns all targets with health status.
func (*Handlers) HandleRefreshDiscovery ¶
HandleRefreshDiscovery forces a FARP re-scan.
func (*Handlers) HandleRegisterService ¶
HandleRegisterService accepts a service registration push. Services POST their info to this endpoint so the gateway can build routes from their FARP manifest.
func (*Handlers) HandleUpdateRoute ¶
HandleUpdateRoute updates an existing route.