Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientFieldSpec ¶
ClientFieldSpec returns a field spec for an http client component.
func ServerCORSFieldSpec ¶
ServerCORSFieldSpec returns a field spec for an http server CORS component.
Types ¶
type Config ¶
type Config struct {
URL string `json:"url" yaml:"url"`
Verb string `json:"verb" yaml:"verb"`
Headers map[string]string `json:"headers" yaml:"headers"`
Metadata metadata.IncludeFilterConfig `json:"metadata" yaml:"metadata"`
ExtractMetadata metadata.IncludeFilterConfig `json:"extract_headers" yaml:"extract_headers"`
RateLimit string `json:"rate_limit" yaml:"rate_limit"`
Timeout string `json:"timeout" yaml:"timeout"`
Retry string `json:"retry_period" yaml:"retry_period"`
MaxBackoff string `json:"max_retry_backoff" yaml:"max_retry_backoff"`
NumRetries int `json:"retries" yaml:"retries"`
BackoffOn []int `json:"backoff_on" yaml:"backoff_on"`
DropOn []int `json:"drop_on" yaml:"drop_on"`
SuccessfulOn []int `json:"successful_on" yaml:"successful_on"`
TLS tls.Config `json:"tls" yaml:"tls"`
ProxyURL string `json:"proxy_url" yaml:"proxy_url"`
auth.Config `json:",inline" yaml:",inline"`
OAuth2 auth.OAuth2Config `json:"oauth2" yaml:"oauth2"`
}
Config is a configuration struct for an HTTP client.
type ServerCORS ¶
type ServerCORS struct {
Enabled bool `json:"enabled" yaml:"enabled"`
AllowedOrigins []string `json:"allowed_origins" yaml:"allowed_origins"`
}
ServerCORS contains configuration for allowing CORS headers.
func NewServerCORS ¶
func NewServerCORS() ServerCORS
NewServerCORS returns a new server CORS config with default fields.
func (ServerCORS) WrapHandler ¶
WrapHandler wraps a provided HTTP handler with middleware that enables CORS requests (when configured).
Click to show internal directories.
Click to hide internal directories.