Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HeaderForwardedAddress is the forwarded address field in request header. HeaderForwardedAddress = "X-Incus-forwarded-address" // HeaderForwardedUsername is the forwarded username field in request header. HeaderForwardedUsername = "X-Incus-forwarded-username" // HeaderForwardedProtocol is the forwarded protocol field in request header. HeaderForwardedProtocol = "X-Incus-forwarded-protocol" )
Headers.
Variables ¶
This section is empty.
Functions ¶
func CreateRequestor ¶
func CreateRequestor(r *http.Request) *api.EventLifecycleRequestor
CreateRequestor extracts the lifecycle event requestor data from an http.Request context.
func ProjectParam ¶ added in v0.2.0
ProjectParam returns the project query parameter from the given request or "default" if parameter is not set.
func QueryParam ¶ added in v0.2.0
QueryParam extracts the given query parameter directly from the URL, never from an encoded body.
Types ¶
type CtxKey ¶
type CtxKey string
CtxKey is the type used for all fields stored in the request context.
const ( // CtxAccess is the access field in request context. CtxAccess CtxKey = "access" // CtxConn is the connection field in the request context. CtxConn CtxKey = "conn" // CtxAddress is the address field in request context. CtxAddress CtxKey = "address" // CtxUsername is the username field in request context. CtxUsername CtxKey = "username" // CtxProtocol is the protocol field in request context. CtxProtocol CtxKey = "protocol" // CtxForwardedAddress is the forwarded address field in request context. CtxForwardedAddress CtxKey = "forwarded_address" // CtxForwardedUsername is the forwarded username field in request context. CtxForwardedUsername CtxKey = "forwarded_username" // CtxForwardedProtocol is the forwarded protocol field in request context. CtxForwardedProtocol CtxKey = "forwarded_protocol" )
Context keys.
Click to show internal directories.
Click to hide internal directories.