Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultPath string = "/"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lookup ¶
Lookup is a map of *Options
func (Lookup) Initialize ¶
Initialize initializes all path options in the lookup
type Options ¶
type Options struct {
// Path indicates the HTTP Request's URL PATH to which this configuration applies
Path string `yaml:"path,omitempty"`
// MatchTypeName indicates the type of path match the router will apply to the path ('exact' or 'prefix')
MatchTypeName matching.PathMatchName `yaml:"match_type,omitempty"`
// HandlerName provides the name of the HTTP handler to use
HandlerName string `yaml:"handler,omitempty"`
// Methods provides the list of permitted HTTP request methods for this Path
Methods []string `yaml:"methods,omitempty"`
// CacheKeyParams provides the list of http request query parameters to be included
// in the hash for each request's cache key
CacheKeyParams []string `yaml:"cache_key_params,omitempty"`
// CacheKeyHeaders provides the list of http request headers to be included in the hash for each request's cache key
CacheKeyHeaders []string `yaml:"cache_key_headers,omitempty"`
// CacheKeyFormFields provides the list of http request body fields to be included
// in the hash for each request's cache key
CacheKeyFormFields []string `yaml:"cache_key_form_fields,omitempty"`
// RequestHeaders is a map of headers that will be added to requests to the upstream Origin for this path
RequestHeaders types.EnvStringMap `yaml:"request_headers,omitempty"`
// RequestParams is a map of parameters that will be added to requests to the upstream Origin for this path
RequestParams types.EnvStringMap `yaml:"request_params,omitempty"`
// ResponseHeaders is a map of http headers that will be added to responses to the downstream client
ResponseHeaders types.EnvStringMap `yaml:"response_headers,omitempty"`
// ResponseCode sets a custom response code to be sent to downstream clients for this path.
ResponseCode int `yaml:"response_code,omitempty"`
// ResponseBody sets a custom response body to be sent to the donstream client for this path.
ResponseBody *string `yaml:"response_body,omitempty"`
// CollapsedForwardingName indicates 'basic' or 'progressive' Collapsed Forwarding to be used by this path.
CollapsedForwardingName string `yaml:"collapsed_forwarding,omitempty"`
// ReqRewriterName is the name of a configured Rewriter that will modify the request prior to
// processing by the backend client
ReqRewriterName string `yaml:"req_rewriter_name,omitempty"`
// NoMetrics, when set to true, disables metrics decoration for the path
NoMetrics bool `yaml:"no_metrics,omitempty"`
// AuthenticatorName specifies the name of the optional Authenticator to attach to this Path
AuthenticatorName string `yaml:"authenticator_name,omitempty"`
// Handler is the HTTP Handler represented by the Path's HandlerName
Handler http.Handler `yaml:"-"`
// ResponseBodyBytes provides a byte slice version of the ResponseBody value
ResponseBodyBytes []byte `yaml:"-"`
// MatchType is the PathMatchType representation of MatchTypeName
MatchType matching.PathMatchType `yaml:"-"`
// CollapsedForwardingType is the typed representation of CollapsedForwardingName
CollapsedForwardingType forwarding.CollapsedForwardingType `yaml:"-"`
// KeyHasher points to an optional function that hashes the cacheKey with a custom algorithm
// NOTE: This can be used by backends, but is not configurable by end users.
KeyHasher key.HasherFunc `yaml:"-"`
// ReqRewriter is the rewriter handler as indicated by RuleName
ReqRewriter rewriter.RewriteInstructions `yaml:"-"`
// AuthOptions is the authenticator as indicated by AuthenticatorName
AuthOptions *autho.Options `yaml:"-"`
}
Options defines a URL Path that is associated with an HTTP Handler
func (*Options) Initialize ¶
Initialize sets up the path Options with default values and overlays any values that were set during YAML unmarshaling
Click to show internal directories.
Click to hide internal directories.