Documentation ¶
Index ¶
- Constants
- func GetGoroutineID() uint64
- func GetLocalAddrIp() string
- type Application
- func (app *Application) Delete(path string, cbFunc ...Handler) error
- func (app *Application) Get(path string, cbFunc ...Handler) error
- func (app *Application) Head(path string, cbFunc ...Handler) error
- func (app *Application) Options(path string, cbFunc ...Handler) error
- func (app *Application) Patch(path string, cbFunc ...Handler) error
- func (app *Application) Post(path string, cbFunc ...Handler) error
- func (app *Application) Put(path string, cbFunc ...Handler) error
- func (app *Application) Run(port int) error
- func (app *Application) RunTLS(port int, certFile string, keyFile string) error
- func (app *Application) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (app *Application) Use(argus ...interface{})
- type Context
- func (ctx *Context) GetCookie(key string) *http.Cookie
- func (ctx *Context) GetData(key string) interface{}
- func (ctx *Context) GetHeader(key string) []string
- func (ctx *Context) SetBody(data []byte)
- func (ctx *Context) SetCookie(cookie *http.Cookie)
- func (ctx *Context) SetData(key string, value interface{})
- func (ctx *Context) SetHeader(key string, value string)
- type Handle
- type Handler
- type Next
Constants ¶
View Source
const ( GET = "get" POST = "post" PUT = "put" DELETE = "delete" PATCH = "patch" OPTIONS = "options" HEAD = "head" USE = "use" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application Object
func (*Application) Delete ¶
func (app *Application) Delete(path string, cbFunc ...Handler) error
Delete func
func (*Application) Get ¶
func (app *Application) Get(path string, cbFunc ...Handler) error
Get func
func (*Application) Head ¶
func (app *Application) Head(path string, cbFunc ...Handler) error
Head func
func (*Application) Options ¶
func (app *Application) Options(path string, cbFunc ...Handler) error
Options func
func (*Application) Patch ¶
func (app *Application) Patch(path string, cbFunc ...Handler) error
Patch func
func (*Application) Post ¶
func (app *Application) Post(path string, cbFunc ...Handler) error
Post func
func (*Application) Put ¶
func (app *Application) Put(path string, cbFunc ...Handler) error
Put func
func (*Application) RunTLS ¶
func (app *Application) RunTLS(port int, certFile string, keyFile string) error
RunTLS func
func (*Application) ServeHTTP ¶
func (app *Application) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP interface func
func (*Application) Use ¶
func (app *Application) Use(argus ...interface{})
Add a middleware for koa application *
- params: path<string|option> path for request
- params: callback<koa.Handler|option> cb for request
- params: callback ...
type Context ¶
type Context struct { Res http.ResponseWriter // instance for response Req *http.Request // instance for request Url string // Url for request Path string // Path for request Method string // Method for request Status int // Status for response Body []uint8 // Body from request Query map[string]interface{} // Query from request Params map[string](string) // Params from request // contains filtered or unexported fields }
Context Request
func NewContext ¶ added in v1.3.0
func NewContext(res http.ResponseWriter, req *http.Request) *Context
New a context for request
Click to show internal directories.
Click to hide internal directories.