Gateway

Functions

Public API reference for the Gateway extension

Extension Entry Points

FunctionDescription
NewExtension(opts ...ConfigOption) forge.ExtensionCreate the gateway extension with functional options
DefaultConfig() ConfigReturns the default configuration

Extension Accessors

MethodDescription
RouteManager() *RouteManagerAccess the route manager for CRUD operations
HealthMonitor() *HealthMonitorAccess the upstream health monitor
Stats() map[string]anyGet gateway statistics
Hooks() *HookManagerAccess the hook system
Auth() *GatewayAuthAccess the auth handler
Cache() *ResponseCacheAccess the response cache
TLS() *TLSManagerAccess the TLS manager
OpenAPI() *OpenAPIAggregatorAccess the OpenAPI aggregator

Admin REST API

The gateway mounts an admin API (when dashboard is enabled) at the dashboard base path:

Route Management

EndpointDescription
GET /gateway/api/routesList all proxy routes
POST /gateway/api/routesAdd a new route
PUT /gateway/api/routes/:idUpdate a route
DELETE /gateway/api/routes/:idDelete a route
POST /gateway/api/routes/:id/enableEnable a route
POST /gateway/api/routes/:id/disableDisable a route

Monitoring

EndpointDescription
GET /gateway/api/upstreamsList upstream services and health
GET /gateway/api/statsGet gateway statistics
GET /gateway/api/configGet current configuration

Discovery

EndpointDescription
GET /gateway/api/discovery/servicesList discovered services
POST /gateway/api/discovery/refreshForce discovery refresh

OpenAPI

EndpointDescription
GET /gateway/openapi.jsonAggregated OpenAPI specification
GET /gateway/docsSwagger UI
GET /gateway/api/openapi/servicesList upstream OpenAPI specs

Real-time

EndpointDescription
GET /gateway/wsWebSocket for live dashboard updates

How is this guide?

On this page