Documentation ¶
Index ¶
- func GetHeadersFromContext(ctx context.Context) (http.Header, bool)
- func HeadersToContext(h http.Handler) http.Handler
- func LogRequest(h http.Handler) http.Handler
- func Post(h http.Handler) http.Handler
- func SetHeadersToContext(ctx context.Context, h http.Header) context.Context
- type APIKeyAuth
- type CORS
- type ConnLimit
- type OpenTelemetryHandler
- type OriginCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHeadersFromContext ¶
GetHeadersFromContext returns http.Header from context.
func HeadersToContext ¶
HeadersToContext puts HTTP headers to request context.
func LogRequest ¶
LogRequest middleware logs details of request.
Types ¶
type APIKeyAuth ¶
type APIKeyAuth struct {
// contains filtered or unexported fields
}
APIKeyAuth middleware authorizes request using API key authorization. It first tries to use Authorization header to extract API key (Authorization: apikey <KEY>), then checks for api_key URL query parameter. If key not found or invalid then 401 response code is returned.
func NewAPIKeyAuth ¶
func NewAPIKeyAuth(key string) *APIKeyAuth
func (*APIKeyAuth) Middleware ¶
func (a *APIKeyAuth) Middleware(h http.Handler) http.Handler
type CORS ¶
type CORS struct {
// contains filtered or unexported fields
}
CORS middleware.
func NewCORS ¶
func NewCORS(originCheck OriginCheck) *CORS
type ConnLimit ¶
type ConnLimit struct {
// contains filtered or unexported fields
}
func NewConnLimit ¶
func NewConnLimit(node *centrifuge.Node, ruleContainer *rule.Container) *ConnLimit
type OpenTelemetryHandler ¶
type OpenTelemetryHandler struct {
// contains filtered or unexported fields
}
func NewOpenTelemetryHandler ¶
func NewOpenTelemetryHandler(operation string, opts []otelhttp.Option) *OpenTelemetryHandler
func (*OpenTelemetryHandler) Middleware ¶
func (t *OpenTelemetryHandler) Middleware(h http.Handler) http.Handler
type OriginCheck ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.