package
0.9.0-alpha
Repository: https://github.com/comcast/webpa-common.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
No description provided by the author
DeviceId parses out the DeviceNameHeader from the request.
DeviceIdCustom allows the header used for the device name to be customized.
Hash returns a redirector using the default status code of http.StatusTemporaryRedirect.
HashCustom provides a ContextHandler that redirects requests based on a ServiceHash.
Listen produces a ChainHandler that notifies the given list of listeners of request events.
MergeConnections returns an aggregate Connection object that returns false if any of the given Connection objects return false.
NewHealthRequestListener returns a new RequestListener which dispatches request stats.
NewHttpError creates a new HttpError object.
Recover provides panic recovery for a chain of requests.
RequestGate returns a ChainHandler whose requests are gated by the given RequestGate.
WriteError handles writing errors, possibly from panic, in a standard way.
WriteJsonError writes a standard JSON error to the response.

# Constants

The Content-Type header.
The X-Content-Type-Options header.
The X-Webpa-Convey header.
DeviceNameHeader is the standard name of the header which carries the WebPA device.
InvalidConveyPattern is the format pattern used to create an error message indicating that a convey payload was invalid.
InvalidDeviceNameHeaderPattern is the format pattern used to create an error message indicating that a device name was improperly formatted.
The Content-Type value for JSON.
MissingDeviceNameHeaderMessage is the error message indicating that the DeviceNameHeader was missing from the request.
NoSniff is the value used for content options for errors written by this package.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

AuthorizationHandler provides decoration for http.Handler instances and will ensure that requests pass the validator.

# Interfaces

ChainHandler represents an HTTP handler type that is one part of a chain of handlers.
Connection represents some sort of subsystem or remote system that has a notion of being available.
ContextHandler defines the behavior of types which can handle HTTP requests inside a WebPA context.
HttpError extends the error interface to include error information for HTTP responses.
RequestListener gets notified of certain high-level request events.

# Type aliases

Chain represents an ordered slice of ChainHandlers that will be applied to each request.
ChainHandlerFunc is a function type that implements ChainHandler.
ConnectionFunc is a function type that implements Connection.
ContextHandlerFunc is a function type that implements ContextHandler.