Documentation
¶
Index ¶
- Constants
- func HertzRequest(c *Context) *protocol.Request
- func MethodPost(c *Context) bool
- func RequestContext(c *Context) *app.RequestContext
- func SetMode(string)
- func SyncRequestBody(c *Context)
- func SyncRequestURI(c *Context)
- func Wrap(handler HandlerFunc) app.HandlerFunc
- type Context
- func (c *Context) Abort()
- func (c *Context) AbortWithStatus(code int)
- func (c *Context) BindJSON(obj interface{}) error
- func (c *Context) ClientIP() string
- func (c *Context) Deadline() (time.Time, bool)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) Error(err error) *Error
- func (c *Context) FullPath() string
- 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) GetString(key string) string
- func (c *Context) HTML(code int, name string, obj interface{})
- func (c *Context) Header(key, value string)
- func (c *Context) JSON(code int, obj interface{})
- func (c *Context) Next()
- func (c *Context) Param(key string) string
- func (c *Context) Query(key string) string
- func (c *Context) Redirect(code int, location string)
- func (c *Context) Set(key string, value interface{})
- func (c *Context) ShouldBind(obj interface{}) error
- func (c *Context) ShouldBindJSON(obj interface{}) error
- func (c *Context) ShouldBindQuery(obj interface{}) error
- func (c *Context) ShouldBindUri(obj interface{}) error
- func (c *Context) Status(code int)
- func (c *Context) String(code int, format string, values ...interface{})
- func (c *Context) Value(key interface{}) interface{}
- type Engine
- func (e *Engine) Any(path string, handlers ...HandlerFunc)
- func (e *Engine) DELETE(path string, handlers ...HandlerFunc)
- func (e *Engine) GET(path string, handlers ...HandlerFunc)
- func (e *Engine) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup
- func (e *Engine) Hertz() *server.Hertz
- func (e *Engine) LoadHTMLFiles(files ...string)
- func (e *Engine) LoadHTMLGlob(pattern string)
- func (e *Engine) NoRoute(handlers ...HandlerFunc)
- func (e *Engine) POST(path string, handlers ...HandlerFunc)
- func (e *Engine) PUT(path string, handlers ...HandlerFunc)
- func (e *Engine) Run(addr ...string) error
- func (e *Engine) RunTLS(addr, certFile, keyFile string) error
- func (e *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (e *Engine) SetHTMLTemplate(tmpl *template.Template)
- func (e *Engine) Use(handlers ...HandlerFunc)
- type Error
- type ErrorChain
- type H
- type HandlerFunc
- type ResponseWriter
- type RouterGroup
- func (g *RouterGroup) Any(path string, handlers ...HandlerFunc)
- func (g *RouterGroup) DELETE(path string, handlers ...HandlerFunc)
- func (g *RouterGroup) GET(path string, handlers ...HandlerFunc)
- func (g *RouterGroup) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup
- func (g *RouterGroup) POST(path string, handlers ...HandlerFunc)
- func (g *RouterGroup) PUT(path string, handlers ...HandlerFunc)
- func (g *RouterGroup) Use(handlers ...HandlerFunc)
Constants ¶
View Source
const ReleaseMode = "release"
Variables ¶
This section is empty.
Functions ¶
func HertzRequest ¶
func MethodPost ¶
func RequestContext ¶
func RequestContext(c *Context) *app.RequestContext
func SyncRequestBody ¶
func SyncRequestBody(c *Context)
func SyncRequestURI ¶
func SyncRequestURI(c *Context)
func Wrap ¶
func Wrap(handler HandlerFunc) app.HandlerFunc
Types ¶
type Context ¶
type Context struct {
Request *http.Request
Writer ResponseWriter
Errors ErrorChain
// contains filtered or unexported fields
}
func ContextFromRequestContext ¶
func ContextFromRequestContext(ctx *app.RequestContext) (*Context, bool)
func NewContext ¶
func NewContext(base context.Context, ctx *app.RequestContext) *Context
func (*Context) AbortWithStatus ¶
func (*Context) ShouldBind ¶
func (*Context) ShouldBindJSON ¶
func (*Context) ShouldBindQuery ¶
func (*Context) ShouldBindUri ¶
type Engine ¶
type Engine struct {
RemoteIPHeaders []string
// contains filtered or unexported fields
}
func (*Engine) Any ¶
func (e *Engine) Any(path string, handlers ...HandlerFunc)
func (*Engine) DELETE ¶
func (e *Engine) DELETE(path string, handlers ...HandlerFunc)
func (*Engine) GET ¶
func (e *Engine) GET(path string, handlers ...HandlerFunc)
func (*Engine) Group ¶
func (e *Engine) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup
func (*Engine) LoadHTMLFiles ¶
func (*Engine) LoadHTMLGlob ¶
func (*Engine) NoRoute ¶
func (e *Engine) NoRoute(handlers ...HandlerFunc)
func (*Engine) POST ¶
func (e *Engine) POST(path string, handlers ...HandlerFunc)
func (*Engine) PUT ¶
func (e *Engine) PUT(path string, handlers ...HandlerFunc)
func (*Engine) SetHTMLTemplate ¶
func (*Engine) Use ¶
func (e *Engine) Use(handlers ...HandlerFunc)
type ErrorChain ¶
type ErrorChain []*Error
func (ErrorChain) Last ¶
func (e ErrorChain) Last() *Error
func (ErrorChain) String ¶
func (e ErrorChain) String() string
type ResponseWriter ¶
type RouterGroup ¶
type RouterGroup struct {
// contains filtered or unexported fields
}
func (*RouterGroup) Any ¶
func (g *RouterGroup) Any(path string, handlers ...HandlerFunc)
func (*RouterGroup) DELETE ¶
func (g *RouterGroup) DELETE(path string, handlers ...HandlerFunc)
func (*RouterGroup) GET ¶
func (g *RouterGroup) GET(path string, handlers ...HandlerFunc)
func (*RouterGroup) Group ¶
func (g *RouterGroup) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup
func (*RouterGroup) POST ¶
func (g *RouterGroup) POST(path string, handlers ...HandlerFunc)
func (*RouterGroup) PUT ¶
func (g *RouterGroup) PUT(path string, handlers ...HandlerFunc)
func (*RouterGroup) Use ¶
func (g *RouterGroup) Use(handlers ...HandlerFunc)
Click to show internal directories.
Click to hide internal directories.