Versions in this module Expand all Collapse all v1 v1.1.0 May 6, 2022 Changes in this version + func RequestID(next http.Handler) http.Handler + func RequestIDFromContext(ctx context.Context) string v1.0.0 Dec 14, 2019 Changes in this version + const StatusNoResponse + var DefaultTimeFormat = time.RFC1123 + var ErrAlreadyDone = errors.New("job already completed") + var ErrNotCompleted = errors.New("task has not been completed") + var ErrNotStarted = errors.New("job has not been started") + func Bearer(r *http.Request) (string, bool) + func BodyClose(next http.Handler) http.Handler + func Chain(handlers ...interface{}) http.Handler + func ClaimsFromContextTo(ctx context.Context, recv interface{}) (err error) + func ContextHandler(next http.Handler) http.Handler + func Go(ctx context.Context, handler func(stop <-chan struct{}) error) error + func RequestCodecFromContext(ctx context.Context) codec.Codec + func ResponseCodecFromContext(ctx context.Context) codec.Codec + type BaseController struct + func NewBaseController() *BaseController + func (bc *BaseController) AddMiddleware(method string, chain ...Middleware) Controller + func (bc *BaseController) Init() error + func (bc *BaseController) Middleware(method string) Middleware + type Claims interface + Valid func() error + type ClaimsFactory func() Claims + type Codecs interface + Lookup func(mimeType string) codec.Codec + type Controller interface + AddMiddleware func(method string, chain ...Middleware) Controller + Middleware func(method string) Middleware + type HandlerTask interface + Complete func(interface{}, error) error + Do func(context.Context, func(<-chan struct{}) error) + Resolve func() (interface{}, error) + Status func() JobStatus + func GetHandlerTask(ctx context.Context) (HandlerTask, bool) + type JWTParser interface + Parse func(jwt string, recv *Claims) error + type JobStatus int + const StatusDone + const StatusInProgress + const StatusWaiting + type Middleware func(http.Handler) http.Handler + func AsyncRequest(reqTimeout, asyncTimeout, keepResult time.Duration) Middleware + func Codec(fn errors.HandlerFunc, codecs Codecs) Middleware + func ContextDeadline(timeout time.Duration) Middleware + func JWT(parser JWTParser, cf ClaimsFactory) Middleware + func New(middlewares ...Middleware) Middleware + func PanicRecover(onPanic OnPanic) Middleware + func RequestLimiter(fn errors.HandlerFunc, maxConcurrentRequests int) Middleware + func SetHeaders(headers map[string]string) Middleware + func Throttle(count int64, duration time.Duration) Middleware + func (mw Middleware) Then(final http.Handler) http.Handler + func (mw Middleware) Use(middlewares ...Middleware) Middleware + type MiddlewareFunc func(http.ResponseWriter, *http.Request, http.Handler) + type OnPanic func(http.ResponseWriter, interface{})