Documentation ¶
Index ¶
- Constants
- func ReadBodyTimeout(n time.Duration)
- func ReadHeadTimeout(n time.Duration)
- func SetMaxBodyLen(n uint)
- func SetMaxHeadLen(n uint)
- type AuthFun
- type ConnFun
- type Context
- func (c *Context) BodyBytes() []byte
- func (c *Context) GetConn() net.Conn
- func (c *Context) HeadBytes() []byte
- func (c *Context) ReqHeader() (*Header, error)
- func (c *Context) ResBytes(code int, bdbts []byte, hds ...[]byte) error
- func (c *Context) ResHeader() *Header
- func (c *Context) ResJson(code int, body interface{}, hds ...[]byte) error
- func (c *Context) ResString(code int, s string, hds ...[]byte) error
- type Engine
- type Header
- func (c *Header) Bytes() []byte
- func (c *Header) Del(key string)
- func (c *Header) Get(key string) (interface{}, bool)
- func (c *Header) GetBool(key string) bool
- func (c *Header) GetFloat(key string) (float64, error)
- func (c *Header) GetInt(key string) (int64, error)
- func (c *Header) GetString(key string) (string, bool)
- func (c *Header) Set(key string, val interface{})
- type Mp
- type Request
- func (c *Request) Close() error
- func (c *Request) Do(control int, body interface{}, hds ...[]byte) error
- func (c *Request) GetConn() net.Conn
- func (c *Request) ReqHeader() *Header
- func (c *Request) ResBodyBytes() []byte
- func (c *Request) ResBodyJson(bd interface{}) error
- func (c *Request) ResCode() int
- func (c *Request) ResHeadBytes() []byte
- func (c *Request) ResHeader() (*Header, error)
Constants ¶
View Source
const ( // Status is int32 ResStatusOk = 1 ResStatusErr = 2 ResStatusAuth = 3 ResStatusNotFound = 4 )
Variables ¶
This section is empty.
Functions ¶
func ReadBodyTimeout ¶
func ReadHeadTimeout ¶
func SetMaxBodyLen ¶
func SetMaxBodyLen(n uint)
func SetMaxHeadLen ¶
func SetMaxHeadLen(n uint)
Types ¶
type ConnFun ¶
type ConnFun func(res *Context)
返回true则连接不会关闭
func ParamFunHandle ¶
func RPCFunHandle ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) ReadBodyTimeout ¶
func (*Engine) ReadHeadTimeout ¶
func (*Engine) SetMaxBodyLen ¶
func (*Engine) SetMaxHeadLen ¶
type Header ¶
type Header struct { Path string `json:"path"` RelIp string `json:"ip"` // 真实IP Token string `json:"token"` // 请求token Times string `json:"times"` // 请求时间 Info map[string]interface{} `json:"info"` }
func ParseHeader ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) ResBodyBytes ¶
func (*Request) ResBodyJson ¶
func (*Request) ResHeadBytes ¶
Click to show internal directories.
Click to hide internal directories.