Documentation
¶
Index ¶
- Constants
- func AddOptions(options map[interface{}]interface{}) pipes.Middleware
- func Context(ctx context.Context, w http.ResponseWriter, r *http.Request, next pipes.Next)
- func CookieAuth(authCookieName string, cookieDec cookieDecoder, userFac userFactory) pipes.Middleware
- func LimitPerMinute(t time.Time) time.Time
- func LimitRate(timeFun func(time.Time) time.Time, limit int) pipes.Middleware
- func PanicHandler(...) pipes.Middleware
Constants ¶
View Source
const User = pipes.ContextKey("User")
User context key
Variables ¶
This section is empty.
Functions ¶
func AddOptions ¶ added in v1.0.1
func AddOptions(options map[interface{}]interface{}) pipes.Middleware
AddOptions adds context options
func CookieAuth ¶
func CookieAuth(authCookieName string, cookieDec cookieDecoder, userFac userFactory) pipes.Middleware
CookieAuth creates cookie auth middleware.
func LimitPerMinute ¶
LimitPerMinute round time to a minute
func PanicHandler ¶
func PanicHandler(handler func(ctx context.Context, w http.ResponseWriter, r *http.Request, err interface{})) pipes.Middleware
PanicHandler creates middleware which recovers from panic in the pipeline and can return user friedly message or page. Should be added as early as possible in the pipeline to handle panics from other middlewares.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.