Documentation ¶
Index ¶
Constants ¶
ErrUnauthorized represents token validation errors.
Variables ¶
This section is empty.
Functions ¶
func NewMiddleware ¶
func NewMiddleware(ctx context.Context, apiKeyID string, opts ...Option) (func(http.Handler) http.Handler, error)
NewMiddleware creates new Cotter authentication middleware.
Types ¶
type ErrorHandler ¶
type ErrorHandler func(w http.ResponseWriter, r *http.Request, e error)
ErrorHandler function.
type Option ¶
type Option func(*options)
Option for the middleware.
func WithErrorHandler ¶
func WithErrorHandler(errorHandler ErrorHandler) Option
WithErrorHandler option sets custom error handler for the middleware.
Click to show internal directories.
Click to hide internal directories.