Documentation
¶
Overview ¶
Package club provides middleware for use in HTTP API servers and gateways.
Index ¶
Constants ¶
View Source
const (
DefaultRequestContextHeader = "x-amzn-request-context"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RequestContext ¶
type RequestContext struct {
Namespace uuid.UUID
ClientCertificate *x509.Certificate
ClientPublicKey *ecdsa.PublicKey
SourceIP string `json:"sourceIp"`
UserAgent string `json:"userAgent"`
}
func FromContext ¶
func FromContext(ctx context.Context) (r *RequestContext, ok bool)
FromContext returns a *RequestContext from http.Request.Context. If it doesn't exist (i.e. Heimdall hasn't run yet), the second return parameter is false.
func MustFromContext ¶
func MustFromContext(ctx context.Context) *RequestContext
MustFromContext is identical to FromContext, except that it panics if the context doesn't have a RequestContext object. Heimdall must have run before this function is called.
func (RequestContext) MarshalJSON ¶
func (r RequestContext) MarshalJSON() ([]byte, error)
func (*RequestContext) UnmarshalJSON ¶
func (r *RequestContext) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.