Documentation ¶
Index ¶
- func GetPool() *pool.BufferPool
- func Stack() []byte
- type Ace
- type C
- func (c *C) Abort()
- func (c *C) AbortWithStatus(status int)
- func (c *C) ClientIP() string
- func (c *C) Download(status int, v []byte)
- func (c *C) Get(key string) interface{}
- func (c *C) GetAll() map[string]interface{}
- func (c *C) HTML(name string, data interface{})
- func (c *C) HTTPLang() string
- func (c *C) JSON(status int, v interface{})
- func (c *C) MustPostFloat64(key string, d float64) float64
- func (c *C) MustPostInt(key string, d int) int
- func (c *C) MustPostString(key, d string) string
- func (c *C) MustPostStrings(key string, d []string) []string
- func (c *C) MustPostTime(key string, layout string, d time.Time) time.Time
- func (c *C) MustQueryFloat64(key string, d float64) float64
- func (c *C) MustQueryInt(key string, d int) int
- func (c *C) MustQueryString(key, d string) string
- func (c *C) MustQueryStrings(key string, d []string) []string
- func (c *C) MustQueryTime(key string, layout string, d time.Time) time.Time
- func (c *C) Next()
- func (c *C) Panic(err error)
- func (c *C) Param(name string) string
- func (c *C) ParseJSON(v interface{})
- func (c *C) Redirect(url string)
- func (c *C) Sessions(name string) *sessions.Session
- func (c *C) Set(key string, v interface{})
- func (c *C) SetAll(data map[string]interface{})
- func (c *C) String(status int, format string, val ...interface{})
- type Context
- type HandlerFunc
- type PanicHandler
- type Renderer
- type ResponseWriter
- type Router
- func (r *Router) DELETE(path string, handlers ...HandlerFunc)
- func (r *Router) GET(path string, handlers ...HandlerFunc)
- func (r *Router) Group(path string, handlers ...HandlerFunc) *Router
- func (r *Router) HEAD(path string, handlers ...HandlerFunc)
- func (r *Router) HTTPHandlerFunc(h http.HandlerFunc) HandlerFunc
- func (r *Router) Handle(method, path string, handlers []HandlerFunc)
- func (r *Router) OPTIONS(path string, handlers ...HandlerFunc)
- func (r *Router) PATCH(path string, handlers ...HandlerFunc)
- func (r *Router) POST(path string, handlers ...HandlerFunc)
- func (r *Router) PUT(path string, handlers ...HandlerFunc)
- func (r *Router) Panic(h PanicHandler)
- func (r *Router) RouteNotFound(h HandlerFunc)
- func (r *Router) Static(path string, root http.Dir, handlers ...HandlerFunc)
- func (r *Router) Use(middlewares ...HandlerFunc)
- type SessionOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPool ¶
func GetPool() *pool.BufferPool
Types ¶
type Ace ¶
type Ace struct { *Router // contains filtered or unexported fields }
func (*Ace) HtmlTemplate ¶
HtmlTemplate use html template middleware
type C ¶
type C struct { Request *http.Request Writer ResponseWriter // contains filtered or unexported fields }
C is context for every goroutine
func (*C) AbortWithStatus ¶
AbortWithStatus stop maddileware and return http status code
func (*C) MustPostString ¶
func (*C) MustQueryString ¶
func (*C) MustQueryTime ¶
type HandlerFunc ¶
type HandlerFunc func(c *C)
func Session ¶
func Session(store sessions.Store, options *SessionOptions) HandlerFunc
Session use session middleware
type PanicHandler ¶
type PanicHandler func(c *C, rcv interface{})
type Renderer ¶
type Renderer interface {
Render(w http.ResponseWriter, name string, data interface{})
}
Renderer html render interface
type ResponseWriter ¶
type ResponseWriter interface { http.ResponseWriter http.Flusher // Status returns the status code of the response or 0 if the response has not been written. Status() int // Written returns whether or not the ResponseWriter has been written. Written() bool // Size returns the size of the response body. Size() int // Before allows for a function to be called before the ResponseWriter has been written to. This is // useful for setting headers or any other operations that must happen before a response has been written. Before(func(ResponseWriter)) }
ResponseWriter is a wrapper around http.ResponseWriter that provides extra information about the response. It is recommended that middleware handlers use this construct to wrap a responsewriter if the functionality calls for it.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router http router
func (*Router) DELETE ¶
func (r *Router) DELETE(path string, handlers ...HandlerFunc)
DELETE handle DELETE method
func (*Router) GET ¶
func (r *Router) GET(path string, handlers ...HandlerFunc)
GET handle GET method
func (*Router) Group ¶
func (r *Router) Group(path string, handlers ...HandlerFunc) *Router
Group group route
func (*Router) HEAD ¶
func (r *Router) HEAD(path string, handlers ...HandlerFunc)
HEAD handle HEAD method
func (*Router) HTTPHandlerFunc ¶
func (r *Router) HTTPHandlerFunc(h http.HandlerFunc) HandlerFunc
HandlerFunc convert http.HandlerFunc to ace.HandlerFunc
func (*Router) Handle ¶
func (r *Router) Handle(method, path string, handlers []HandlerFunc)
Handle handle with specific method
func (*Router) OPTIONS ¶
func (r *Router) OPTIONS(path string, handlers ...HandlerFunc)
OPTIONS handle OPTIONS method
func (*Router) PATCH ¶
func (r *Router) PATCH(path string, handlers ...HandlerFunc)
PATCH handle PATCH method
func (*Router) POST ¶
func (r *Router) POST(path string, handlers ...HandlerFunc)
POST handle POST method
func (*Router) PUT ¶
func (r *Router) PUT(path string, handlers ...HandlerFunc)
PUT handle PUT method
func (*Router) RouteNotFound ¶
func (r *Router) RouteNotFound(h HandlerFunc)
RouteNotFound call when route does not match
type SessionOptions ¶
type SessionOptions struct { Path string Domain string // MaxAge=0 means no 'Max-Age' attribute specified. // MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'. // MaxAge>0 means Max-Age attribute present and given in seconds. MaxAge int Secure bool HTTPOnly bool }
SessionOptions session options