Documentation ¶
Index ¶
- Constants
- func Dir(root string, listDir bool) http.FileSystem
- func GzipHandler(next http.Handler) http.Handler
- func LoggerMiddleware(c *Context)
- func RecoveryMiddleware(c *Context)
- type Context
- func (c *Context) Abort()
- func (c *Context) AbortWithStatus(code int)
- func (c *Context) BindJSON(obj interface{}) error
- func (c *Context) File(filePath string)
- func (c *Context) FormFile(key string) (*multipart.FileHeader, error)
- func (c *Context) Get(key string) (interface{}, bool)
- func (c *Context) GetHeader(key string) string
- func (c *Context) GetQuery(key string) (string, bool)
- func (c *Context) GetQueryArray(key string) ([]string, bool)
- func (c *Context) Header(key, value string)
- func (c *Context) IndentedJSON(code int, val interface{})
- func (c *Context) JSON(code int, val interface{})
- func (c *Context) Next()
- func (c *Context) PostForm(key string) string
- func (c *Context) PostFormArray(key string) []string
- func (c *Context) Redirect(code int, location string)
- func (c *Context) Set(key string, obj interface{})
- func (c *Context) String(code int, format string, values ...interface{})
- func (c *Context) Text(code int, message string)
- type Engine
- type H
- type MiddlewareTree
- type ResponseWriterWrapper
- type RouteGroup
- func (rg *RouteGroup) Any(path string, handler RouteHandler)
- func (rg *RouteGroup) DELETE(path string, handler RouteHandler)
- func (rg *RouteGroup) Delete(path string, handler RouteHandler)
- func (rg *RouteGroup) GET(path string, handler RouteHandler)
- func (rg *RouteGroup) Get(path string, handler RouteHandler)
- func (rg *RouteGroup) Group(prefix string) *RouteGroup
- func (rg *RouteGroup) HEAD(path string, handler RouteHandler)
- func (rg *RouteGroup) Head(path string, handler RouteHandler)
- func (rg *RouteGroup) OPTIONS(path string, handler RouteHandler)
- func (rg *RouteGroup) Options(path string, handler RouteHandler)
- func (rg *RouteGroup) POST(path string, handler RouteHandler)
- func (rg *RouteGroup) PUT(path string, handler RouteHandler)
- func (rg *RouteGroup) Post(path string, handler RouteHandler)
- func (rg *RouteGroup) Put(path string, handler RouteHandler)
- func (rg *RouteGroup) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (rg *RouteGroup) StaticFile(path, filePath string)
- func (rg *RouteGroup) Use(middlewares ...RouteHandler)
- type RouteHandler
- type RouteHandlerChain
Constants ¶
View Source
const INDEX = "index.html"
Variables ¶
This section is empty.
Functions ¶
func LoggerMiddleware ¶
func LoggerMiddleware(c *Context)
func RecoveryMiddleware ¶
func RecoveryMiddleware(c *Context)
Types ¶
type Context ¶
type Context struct { Method string Request *http.Request Writer http.ResponseWriter // contains filtered or unexported fields }
func (*Context) AbortWithStatus ¶
func (*Context) IndentedJSON ¶
func (*Context) PostFormArray ¶
type Engine ¶
type Engine struct {
*RouteGroup
}
type MiddlewareTree ¶ added in v1.0.7
type MiddlewareTree struct {
// contains filtered or unexported fields
}
func (*MiddlewareTree) Add ¶ added in v1.0.7
func (mt *MiddlewareTree) Add(prefix string, handler RouteHandler)
func (*MiddlewareTree) BuildMiddlewares ¶ added in v1.0.7
func (mt *MiddlewareTree) BuildMiddlewares(path string) RouteHandlerChain
type ResponseWriterWrapper ¶
type ResponseWriterWrapper struct { http.ResponseWriter http.Hijacker // contains filtered or unexported fields }
func (*ResponseWriterWrapper) WriteHeader ¶
func (w *ResponseWriterWrapper) WriteHeader(code int)
type RouteGroup ¶
type RouteGroup struct {
// contains filtered or unexported fields
}
func NewRouteGroup ¶
func NewRouteGroup() *RouteGroup
func (*RouteGroup) Any ¶
func (rg *RouteGroup) Any(path string, handler RouteHandler)
func (*RouteGroup) DELETE ¶
func (rg *RouteGroup) DELETE(path string, handler RouteHandler)
func (*RouteGroup) Delete ¶
func (rg *RouteGroup) Delete(path string, handler RouteHandler)
func (*RouteGroup) GET ¶
func (rg *RouteGroup) GET(path string, handler RouteHandler)
func (*RouteGroup) Get ¶
func (rg *RouteGroup) Get(path string, handler RouteHandler)
func (*RouteGroup) Group ¶
func (rg *RouteGroup) Group(prefix string) *RouteGroup
func (*RouteGroup) HEAD ¶
func (rg *RouteGroup) HEAD(path string, handler RouteHandler)
func (*RouteGroup) Head ¶
func (rg *RouteGroup) Head(path string, handler RouteHandler)
func (*RouteGroup) OPTIONS ¶
func (rg *RouteGroup) OPTIONS(path string, handler RouteHandler)
func (*RouteGroup) Options ¶
func (rg *RouteGroup) Options(path string, handler RouteHandler)
func (*RouteGroup) POST ¶
func (rg *RouteGroup) POST(path string, handler RouteHandler)
func (*RouteGroup) PUT ¶
func (rg *RouteGroup) PUT(path string, handler RouteHandler)
func (*RouteGroup) Post ¶
func (rg *RouteGroup) Post(path string, handler RouteHandler)
func (*RouteGroup) Put ¶
func (rg *RouteGroup) Put(path string, handler RouteHandler)
func (*RouteGroup) ServeHTTP ¶
func (rg *RouteGroup) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*RouteGroup) StaticFile ¶
func (rg *RouteGroup) StaticFile(path, filePath string)
func (*RouteGroup) Use ¶
func (rg *RouteGroup) Use(middlewares ...RouteHandler)
type RouteHandler ¶
type RouteHandler func(c *Context)
func StaticFileMiddleware ¶
func StaticFileMiddleware(urlPrefix, root string, indexes bool) RouteHandler
type RouteHandlerChain ¶ added in v1.0.7
type RouteHandlerChain []RouteHandler
Click to show internal directories.
Click to hide internal directories.