Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultErrorHandler = ErrorEncoder
)
Functions ¶
func ErrorEncoder ¶
func ErrorEncoder(_ context.Context, err error, w http.ResponseWriter)
Types ¶
type Config ¶
type Config struct {
ErrorHandler func(ctx context.Context, err error, w http.ResponseWriter)
}
func DefaultConfig ¶
func DefaultConfig() Config
type Context ¶
type Context struct {
context.Context
ResponseWriter http.ResponseWriter
Request *http.Request
// contains filtered or unexported fields
}
func (*Context) StatusCode ¶
type Handler ¶
func CombineHandlers ¶
func CombineHandlers(cfg Config, h ...HandlerFunc) Handler
CombineHandlers returns a http Handler
type HandlerFunc ¶
func BasicAuthor ¶
func BasicAuthor(author func(username, password string) bool) HandlerFunc
type Server ¶
type Server interface {
http.Handler
Use(middleware ...HandlerFunc)
Handle(pattern string, handlers ...HandlerFunc)
}
Click to show internal directories.
Click to hide internal directories.