Documentation ¶
Index ¶
- func AppDefer(deferFun ...func())
- func AppStart(appSrv AppSrv)
- func ExitWaitFunDo(doFun func())
- func ListenStop(stopSig chan StopSignal)
- func ParseForm(form url.Values, obj interface{}) error
- func ParseJson(jsonByte []byte, obj interface{}) error
- type AppSrv
- type Context
- func (c *Context) AppUpload(formName string) (savePath string, err error)
- func (c *Context) Context() context.Context
- func (c *Context) GetCtxParam(key string) (val interface{})
- func (c *Context) Header() http.Header
- func (c *Context) HttpError(error string, code int)
- func (c *Context) Input() url.Values
- func (c *Context) ParseForm(obj interface{}) error
- func (c *Context) Request() *http.Request
- func (c *Context) ResponseHeader() http.Header
- func (c *Context) ResponseReset()
- func (c *Context) ResponseWrite(b []byte) error
- func (c *Context) ResponseWriteHeader(code int)
- func (c *Context) Session() session.Store
- func (c *Context) SetCookie(cookie *http.Cookie)
- func (c *Context) SetCtxParam(key string, value interface{})
- func (c *Context) SetRW(w http.ResponseWriter, r *http.Request)
- func (c *Context) ToJson(data interface{}) error
- func (c *Context) ToString(data string) error
- func (c *Context) UploadFromFile(formName string, saveDir string, verifyFunc func(file *UploadFile) error) (fileName string, err error)
- func (c *Context) ViewHtml(viewName string, viewData interface{}) error
- func (c *Context) ViewText(viewName string, viewData interface{}) error
- type ErrNoFile
- type HandlerFunc
- type MiddleWare
- type MiddlewareFunc
- type RouterServer
- func (r *RouterServer) ALL(patten string, handler func(ctx *Context) error)
- func (r *RouterServer) DELETE(patten string, handler func(ctx *Context) error)
- func (r *RouterServer) GET(patten string, handler func(ctx *Context) error)
- func (r *RouterServer) GroupRouter(prefix string, middlewares ...MiddleWare) *RouterServer
- func (r *RouterServer) POST(patten string, handler func(ctx *Context) error)
- func (r *RouterServer) PUT(patten string, handler func(ctx *Context) error)
- type StopSignal
- type UploadFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct { OrangeInput *request.OrangeInput CsrfToken string // contains filtered or unexported fields }
func (*Context) GetCtxParam ¶
func (*Context) Input ¶
Input returns the input data map from POST or PUT request body and query string.
func (*Context) ResponseHeader ¶
func (*Context) ResponseReset ¶ added in v0.1.4
func (c *Context) ResponseReset()
func (*Context) ResponseWrite ¶
func (*Context) ResponseWriteHeader ¶ added in v0.1.3
func (*Context) SetCtxParam ¶
func (*Context) UploadFromFile ¶
func (c *Context) UploadFromFile(formName string, saveDir string, verifyFunc func(file *UploadFile) error) (fileName string, err error)
UploadFromFile
type HandlerFunc ¶
type MiddleWare ¶
type MiddleWare interface {
Func() MiddlewareFunc
}
type MiddlewareFunc ¶
type MiddlewareFunc func(HandlerFunc) HandlerFunc
MiddlewareFunc defines a function to process middleware.
type RouterServer ¶
type RouterServer struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(prefix string, middlewares ...MiddleWare) *RouterServer
func (*RouterServer) ALL ¶
func (r *RouterServer) ALL(patten string, handler func(ctx *Context) error)
ALL 兼容所有请求
func (*RouterServer) DELETE ¶
func (r *RouterServer) DELETE(patten string, handler func(ctx *Context) error)
DELETE 注册 delete 请求
func (*RouterServer) GET ¶
func (r *RouterServer) GET(patten string, handler func(ctx *Context) error)
GET 注册 get 请求
func (*RouterServer) GroupRouter ¶
func (r *RouterServer) GroupRouter(prefix string, middlewares ...MiddleWare) *RouterServer
GroupRouter 子群组路由
type StopSignal ¶
type StopSignal int32
type UploadFile ¶
Click to show internal directories.
Click to hide internal directories.