http

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package http adds midlleware to http requests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRequestID

func AddRequestID(h http.Handler) http.Handler

AddRequestID adds request id to handler

func Apply

func Apply(handler http.Handler, middlewares ...Middleware) http.Handler

Apply applies a chain of middleware in order

func GetRequestID

func GetRequestID(ctx context.Context) (int, error)

GetRequestID retrieves the request id from context

func SupportCORS

func SupportCORS(f http.Handler) http.Handler

SupportCORS updates the CORs header for preflight requests

Types

type CookieJWTOptions

type CookieJWTOptions struct {
	SecureCookie *securecookie.SecureCookie
	AuthHeader   string
	AuthScheme   string
	CookieName   string
}

CookieJWTOptions contains parameters for CookieToJWTMiddleware

type Middleware

type Middleware func(http.Handler) http.Handler

Middleware is http middleware

func CookieToJWTMiddleware

func CookieToJWTMiddleware(opt *CookieJWTOptions) Middleware

CookieToJWTMiddleware is a middleware for extracting cookie values to jwt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL