Versions in this module Expand all Collapse all v0 v0.1.0 Oct 25, 2019 Changes in this version + const HeaderAcceptEncoding + const HeaderContentEncoding + const HeaderContentType + const HeaderVary + const MIMEApplicationForm + const MIMEApplicationJSON + const MIMEApplicationJSONCharsetUTF8 + const MIMEApplicationXML + const MIMEApplicationXMLCharsetUTF8 + const MIMEMultipartForm + const MIMEOctetStream + const MIMETextPlain + const MIMETextPlainCharsetUTF8 + const MIMETextXML + const MIMETextXMLCharsetUTF8 + var ErrInvalidContext = errors.New("invalid context type") + type Binder interface + Bind func(*http.Request, interface{}) error + var DefaultBinder Binder = defaultBinder{} + var ErrBindUnsupportedContentType = errors.New("cannot bind content type") + type Context struct + func (c *Context) JSON(status int, value interface{}) error + func (c *Context) Param(key string) string + func (c *Context) Query(key string) string + func (c *Context) Render(status int, r Renderer) error + func (c *Context) Request() *http.Request + func (c *Context) Response() *Response + func (c *Context) Stream(status int, contentType string, reader io.Reader) error + func (c *Context) String(status int, value string) error + func (c *Context) XML(status int, value interface{}) error + type Error struct + Cause error + Message string + Status int + func NewError(status int) *Error + func (e *Error) Error() string + func (e *Error) Unwrap() error + func (e *Error) WithCause(cause error) *Error + func (e *Error) WithMessage(message string) *Error + type FileHandlerOptions struct + Fs http.FileSystem + NotFound string + type Group struct + func NewGroup() *Group + func (g *Group) Add(method, path string, handler Handler, middleware ...Middleware) *Group + func (g *Group) DELETE(path string, handler Handler, middleware ...Middleware) *Group + func (g *Group) Files(path string, opts FileHandlerOptions) *Group + func (g *Group) GET(path string, handler Handler, middleware ...Middleware) *Group + func (g *Group) HEAD(path string, handler Handler, middleware ...Middleware) *Group + func (g *Group) Mount(subgroups ...*Group) *Group + func (g *Group) OPTIONS(path string, handler Handler, middleware ...Middleware) *Group + func (g *Group) POST(path string, handler Handler, middleware ...Middleware) *Group + func (g *Group) PUT(path string, handler Handler, middleware ...Middleware) *Group + func (g *Group) Use(middleware ...Middleware) *Group + func (g *Group) WithPrefix(prefix string) *Group + type Handler interface + type JSONRenderer struct + Value interface{} + func (JSONRenderer) Header(h http.Header) + func (r JSONRenderer) Render(w io.Writer) error + type Middleware interface + type Next func() error + type Renderer interface + Header func(http.Header) + Render func(io.Writer) error + type Response struct + Status int + Writer http.ResponseWriter + func (r *Response) Header() http.Header + func (r *Response) Write(b []byte) (int, error) + func (r *Response) WriteHeader(status int) + type Router struct + Binder Binder + Validator Validator + func NewRouter(contextValue interface{}) *Router + func (r *Router) Mount(g *Group) *Router + func (r *Router) ServeHTTP(res http.ResponseWriter, req *http.Request) + type StreamRenderer struct + ContentType string + Reader io.Reader + func (r StreamRenderer) Header(h http.Header) + func (r StreamRenderer) Render(w io.Writer) error + type StringRenderer struct + String string + func (StringRenderer) Header(h http.Header) + func (r StringRenderer) Render(w io.Writer) error + type Validator interface + Validate func(*http.Request, interface{}) error + var DefaultValidator Validator = defaultValidator{ ... } + type XMLRenderer struct + Value interface{} + func (XMLRenderer) Header(h http.Header) + func (r XMLRenderer) Render(w io.Writer) error