Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayConfig ¶
type GatewayConfig struct { // HTTP timeout for reading a request from clients. ReadTimeout time.Duration // HTTP timeout for writing a response from functions. WriteTimeout time.Duration // UpstreamTimeout maximum duration of HTTP call to upstream URL UpstreamTimeout time.Duration // URL for alternate functions provider. FunctionsProviderURL *url.URL // Address of the NATS service. Required for async mode. NATSAddress *string // Port of the NATS Service. Required for async mode. NATSPort *int // Host to connect to Prometheus. PrometheusHost string // Port to connect to Prometheus. PrometheusPort int // If set to true we will access upstream functions directly rather than through the upstream provider DirectFunctions bool // If set this will be used to resolve functions directly DirectFunctionsSuffix string // If set, reads secrets from file-system for enabling basic auth. UseBasicAuth bool // SecretMountPath specifies where to read secrets from for embedded basic auth SecretMountPath string // Enable the gateway to scale any service from 0 replicas to its configured "min replicas" ScaleFromZero bool MaxIdleConns int MaxIdleConnsPerHost int }
GatewayConfig provides config for the API Gateway server process
func (*GatewayConfig) UseExternalProvider ¶
func (g *GatewayConfig) UseExternalProvider() bool
UseExternalProvider decide whether to bypass built-in Docker Swarm engine
type GatewayInfo ¶
type GatewayInfo struct { Provider *ProviderInfo `json:"provider"` Version *VersionInfo `json:"version"` }
GatewayInfo provides information about the gateway and it's connected components
type HTTPClientReverseProxy ¶
HTTPClientReverseProxy proxy to a remote BaseURL using a http.Client
func NewHTTPClientReverseProxy ¶
func NewHTTPClientReverseProxy(baseURL *url.URL, timeout time.Duration, maxIdleConns, maxIdleConnsPerHost int) *HTTPClientReverseProxy
NewHTTPClientReverseProxy proxies to an upstream host through the use of a http.Client
type HandlerSet ¶
type HandlerSet struct { Proxy http.HandlerFunc DeployFunction http.HandlerFunc DeleteFunction http.HandlerFunc ListFunctions http.HandlerFunc Alert http.HandlerFunc RoutelessProxy http.HandlerFunc UpdateFunction http.HandlerFunc // QueryFunction - queries the metdata for a function QueryFunction http.HandlerFunc // QueuedProxy - queue work and return synchronous response QueuedProxy http.HandlerFunc // AsyncReport - report a deferred execution result AsyncReport http.HandlerFunc // ScaleFunction allows a function to be scaled ScaleFunction http.HandlerFunc // InfoHandler provides version and build info InfoHandler http.HandlerFunc // SecretHandler allows secrets to be managed SecretHandler http.HandlerFunc }
HandlerSet can be initialized with handlers for binding to mux
type ProviderInfo ¶
type ProviderInfo struct { Name string `json:"provider"` Version *VersionInfo `json:"version"` Orchestration string `json:"orchestration"` }
ProviderInfo provides information about the configured provider
type ReadConfig ¶
type ReadConfig struct { }
ReadConfig constitutes config from env variables
func (ReadConfig) Read ¶
func (ReadConfig) Read(hasEnv HasEnv) GatewayConfig
Read fetches gateway server configuration from environmental variables
type VersionInfo ¶
type VersionInfo struct { CommitMessage string `json:"commit_message,omitempty"` SHA string `json:"sha"` Release string `json:"release"` }
VersionInfo provides the commit message, sha and release version number