Forge
1.x
Docs/Forge/Functions
Open

Deprecated

Use Bastion instead.

Reading1 min
Updated31 Jul 2026
Sourcev1/extensions/gateway/functions.mdx

Extension Entry Points01

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

Extension Accessors02

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 API03

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

Discovery Config Options04

FunctionDescription
WithDiscovery(cfg DiscoveryConfig) ConfigOptionSet the full discovery configuration
WithDiscoveryEnabled(bool) ConfigOptionEnable or disable FARP discovery
WithDiscoveryPollInterval(time.Duration) ConfigOptionSet the polling interval
WithDiscoveryWatchMode(bool) ConfigOptionUse watch mode instead of polling
WithDiscoveryAutoPrefix(bool) ConfigOptionAuto-generate path prefixes from service names
WithDiscoveryPrefixTemplate(string) ConfigOptionSet the Go text/template prefix template
WithDiscoveryStripPrefix(bool) ConfigOptionStrip auto-generated prefix before proxying
WithDiscoveryServiceFilters(filters ...ServiceFilter) ConfigOptionSet service filters

Discovery Adapter05

FunctionDescription
NewDiscoveryAdapter(svc *discovery.Service) DiscoveryServiceWrap a *discovery.Service as a gateway DiscoveryService
ConvertFARPRoutes(name string, routes []ServiceRoute, prefix string, strip bool) []*RouteConvert FARP service routes into gateway routes

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