Documentation ¶
Index ¶
- Variables
- func Dev() bool
- func Env() string
- func Group(pattern string, f func(*Router), handlers ...interface{})
- func HandleNotFound(ctx *Context)
- func HandleNotImplemented(ctx *Context)
- func ListenAndServe(addr string, handler http.Handler) error
- func ListenAndServeFCGI(addr string, handler http.Handler) error
- func ListenAndServeTLS(addr, certFile, keyFile string, handler http.Handler) error
- func NewValueKey() (key valueKey)
- func Prod() bool
- func SetEnv(s string)
- func Test() bool
- func Use(handlers ...interface{})
- type Context
- func (ctx *Context) BadRequest()
- func (ctx *Context) ContentDisposition(filename, fallback string)
- func (ctx *Context) ContentLength(i int)
- func (ctx *Context) ContentType(s string)
- func (ctx *Context) ContentTypeCSV()
- func (ctx *Context) ContentTypeHTML()
- func (ctx *Context) ContentTypeJSON()
- func (ctx *Context) ContentTypePlain()
- func (ctx *Context) ContentTypeXLSX()
- func (ctx *Context) ContentTypeXML()
- func (ctx *Context) DecodeJSON(v interface{}) error
- func (ctx *Context) DecodeXML(v interface{}) error
- func (ctx *Context) ETag(s string)
- func (ctx *Context) First(k string) (s string, n int)
- func (ctx *Context) FirstBool(k string) (bool, int)
- func (ctx *Context) FirstFloat32(k string) (float32, int)
- func (ctx *Context) FirstFloat64(k string) (float64, int)
- func (ctx *Context) FirstInt(k string) (int, int)
- func (ctx *Context) FirstUint(k string) (uint, int)
- func (ctx *Context) Forbidden()
- func (ctx *Context) Found(location string)
- func (ctx *Context) IfModifiedSince(t time.Time) bool
- func (ctx *Context) IfNoneMatch(s string) bool
- func (ctx *Context) InternalServerError()
- func (ctx *Context) IsAJAX() bool
- func (ctx *Context) LastModified(t time.Time)
- func (ctx *Context) MaxAge(seconds int)
- func (ctx *Context) MovedPermanently(location string)
- func (ctx *Context) Next()
- func (ctx *Context) NoCache()
- func (ctx *Context) NotFound()
- func (ctx *Context) NotModified()
- func (ctx *Context) Param(name string) string
- func (ctx *Context) ParamBool(name string) (bool, bool)
- func (ctx *Context) ParamFloat32(name string) (float32, bool)
- func (ctx *Context) ParamFloat64(name string) (float64, bool)
- func (ctx *Context) ParamInt(name string) (int, bool)
- func (ctx *Context) ParamUint(name string) (uint, bool)
- func (ctx *Context) ParseRemoteIP(realIP, forwardedFor bool) net.IP
- func (ctx *Context) RemoteIP() (ip net.IP)
- func (ctx *Context) Routed() bool
- func (ctx *Context) ServeFile(name string)
- func (ctx *Context) ServiceUnavailable()
- func (ctx *Context) SetRemoteIP(ip net.IP)
- func (ctx *Context) SetValue(k, v interface{})
- func (ctx *Context) Status() int
- func (ctx *Context) Value(k interface{}) interface{}
- func (ctx *Context) Write(data []byte) (int, error)
- func (ctx *Context) WriteData(v interface{}) (int, error)
- func (ctx *Context) WriteError(e interface{}) (int, error)
- func (ctx *Context) WriteErrorf(format string, a ...interface{}) (int, error)
- func (ctx *Context) WriteHeader(code int)
- func (ctx *Context) WriteJSON(v interface{}) (int, error)
- func (ctx *Context) WritePlain(s string) (int, error)
- func (ctx *Context) WriteString(s string) (int, error)
- func (ctx *Context) WriteXML(v interface{}) (int, error)
- func (ctx *Context) Written() int64
- func (ctx *Context) WroteHeader() bool
- type Handler
- type HandlerFunc
- type Node
- type Route
- func Any(pattern string, handlers ...interface{}) *Route
- func CONNECT(pattern string, handlers ...interface{}) *Route
- func DELETE(pattern string, handlers ...interface{}) *Route
- func GET(pattern string, handlers ...interface{}) *Route
- func HEAD(pattern string, handlers ...interface{}) *Route
- func Handle(method, pattern string, handlers ...interface{}) *Route
- func OPTIONS(pattern string, handlers ...interface{}) *Route
- func POST(pattern string, handlers ...interface{}) *Route
- func PUT(pattern string, handlers ...interface{}) *Route
- func TRACE(pattern string, handlers ...interface{}) *Route
- type Router
- func (r *Router) Any(path string, handlers ...interface{}) *Route
- func (r *Router) CONNECT(path string, handlers ...interface{}) *Route
- func (r *Router) DELETE(path string, handlers ...interface{}) *Route
- func (r *Router) Fallback()
- func (r *Router) GET(path string, handlers ...interface{}) *Route
- func (r *Router) Group(path string, f func(*Router), handlers ...interface{})
- func (r *Router) HEAD(path string, handlers ...interface{}) *Route
- func (r *Router) Handle(method, path string, handlers ...interface{}) *Route
- func (r *Router) Handler() http.Handler
- func (r *Router) OPTIONS(path string, handlers ...interface{}) *Route
- func (r *Router) POST(path string, handlers ...interface{}) *Route
- func (r *Router) PUT(path string, handlers ...interface{}) *Route
- func (r *Router) TRACE(path string, handlers ...interface{}) *Route
- func (r *Router) Use(handlers ...interface{})
- type Static
- type Tag
- type Tree
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRouter = new(Router)
Functions ¶
func HandleNotFound ¶
func HandleNotFound(ctx *Context)
func HandleNotImplemented ¶
func HandleNotImplemented(ctx *Context)
func ListenAndServeTLS ¶
func NewValueKey ¶
func NewValueKey() (key valueKey)
Types ¶
type Context ¶
type Context struct { http.ResponseWriter Request *http.Request Values map[interface{}]interface{} Params []string // contains filtered or unexported fields }
func (*Context) BadRequest ¶
func (ctx *Context) BadRequest()
func (*Context) ContentDisposition ¶
func (*Context) ContentLength ¶
func (*Context) ContentType ¶
func (*Context) ContentTypeCSV ¶
func (ctx *Context) ContentTypeCSV()
func (*Context) ContentTypeHTML ¶
func (ctx *Context) ContentTypeHTML()
func (*Context) ContentTypeJSON ¶
func (ctx *Context) ContentTypeJSON()
func (*Context) ContentTypePlain ¶
func (ctx *Context) ContentTypePlain()
func (*Context) ContentTypeXLSX ¶
func (ctx *Context) ContentTypeXLSX()
func (*Context) ContentTypeXML ¶
func (ctx *Context) ContentTypeXML()
func (*Context) DecodeJSON ¶
func (*Context) IfNoneMatch ¶
func (*Context) InternalServerError ¶
func (ctx *Context) InternalServerError()
func (*Context) LastModified ¶
func (*Context) MovedPermanently ¶
func (*Context) NotModified ¶
func (ctx *Context) NotModified()
func (*Context) ServiceUnavailable ¶
func (ctx *Context) ServiceUnavailable()
func (*Context) SetRemoteIP ¶
func (*Context) WriteError ¶
func (*Context) WriteErrorf ¶
func (*Context) WriteHeader ¶
func (*Context) WroteHeader ¶
type Handler ¶
type Handler interface {
ServeHTTP(*Context)
}
func NewAllowedMethods ¶
func NewRedirectCleanedPath ¶
type HandlerFunc ¶
type HandlerFunc func(*Context)
func (HandlerFunc) ServeHTTP ¶
func (f HandlerFunc) ServeHTTP(ctx *Context)
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.