Documentation ¶
Index ¶
- func APIKeyAuth(key string, h http.Handler) http.Handler
- func CORS(originCheck OriginCheck, h http.Handler) http.Handler
- func ConnLimit(node *centrifuge.Node, ruleContainer *rule.Container, h http.Handler) http.Handler
- func Get(h http.Handler) http.Handler
- func GetHeadersFromContext(ctx context.Context) (http.Header, bool)
- func HeadersToContext(enable bool, 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 OriginCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIKeyAuth ¶
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 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 OriginCheck ¶
Click to show internal directories.
Click to hide internal directories.