Documentation
¶
Index ¶
- Constants
- func AppEngineContext(ctx context.Context, w http.ResponseWriter, r *http.Request, next pipes.Next)
- 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 AppEngineContext ¶
AppEngineContext adds Google App Engine context to the request pipeline
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.