Documentation
¶
Index ¶
- Constants
- Variables
- func BigByteToFloat32(data []byte) float32
- func BigByteToFloat64(data []byte) float64
- func BigByteToInt(data []byte) int64
- func BigFloatToByte32(data float32) []byte
- func BigFloatToByte64(data float64) []byte
- func BigIntToByte(data int64, ln int) []byte
- func Byte2Struct(data []byte, pt interface{}) error
- func Bytes2Struct(data []byte, pt unsafe.Pointer) error
- func Debugf(s string, args ...interface{})
- func DoJson(req *Request, in, out interface{}, hd ...Map) error
- func DoString(req *Request, in interface{}, hd ...Map) (int32, []byte, error)
- func EndContext(ctx context.Context) bool
- func Errorf(s string, args ...interface{})
- func Infof(s string, args ...interface{})
- func LitByteToFloat32(data []byte) float32
- func LitByteToFloat64(data []byte) float64
- func LitByteToInt(data []byte) int64
- func LitFloatToByte32(data float32) []byte
- func LitFloatToByte64(data float64) []byte
- func LitIntToByte(data int64, ln int) []byte
- func PathExists(path string) bool
- func SizeOf(data interface{}) int
- func SizeTOf(data interface{}) int
- func Struct2Byte(pt interface{}) ([]byte, error)
- func Struct2ByteLen(pt interface{}, ln int) ([]byte, error)
- func Struct2Bytes(pt unsafe.Pointer, ln int) ([]byte, error)
- func TcpRead(ctx context.Context, conn net.Conn, ln uint) ([]byte, error)
- type AuthFun
- type Config
- type ConnFun
- type Context
- func (c *Context) Args() url.Values
- func (c *Context) BodyBytes() []byte
- func (c *Context) Command() string
- func (c *Context) Conn(ownership ...bool) net.Conn
- func (c *Context) Control() int32
- func (c *Context) GetData(k string) (interface{}, bool)
- func (c *Context) HeadBytes() []byte
- func (c *Context) IsOwn() bool
- func (c *Context) ReqHeader() *Map
- func (c *Context) ResBytes(code int32, bdbts []byte, hds ...[]byte) error
- func (c *Context) ResHeader() *Map
- func (c *Context) ResJson(code int32, body interface{}, hds ...[]byte) error
- func (c *Context) ResString(code int32, s string, hds ...[]byte) error
- func (c *Context) Sended() bool
- func (c *Context) SetData(k string, data interface{})
- type Engine
- func (c *Engine) Config(conf Config)
- func (c *Engine) NotFoundFun(fn ConnFun)
- func (c *Engine) RegFun(control int32, fn ConnFun) bool
- func (c *Engine) RegGrpcFun(control int32, rpc IRPCRoute) bool
- func (c *Engine) RegParamFun(control int32, fn interface{}) bool
- func (c *Engine) Run(host string) error
- func (c *Engine) Stop()
- type IRPCRoute
- type Map
- func (e *Map) Get(key string) (interface{}, bool)
- func (e *Map) GetBool(key string) bool
- func (e *Map) GetFloat(key string) (float64, error)
- func (e *Map) GetInt(key string) (int64, error)
- func (e *Map) GetString(key string) string
- func (e *Map) Map() map[string]interface{}
- func (e *Map) Set(key string, val interface{})
- func (e *Map) ToBytes() []byte
- func (e *Map) ToString() string
- type Request
- func (c *Request) Args(args url.Values) *Request
- func (c *Request) Close() error
- func (c *Request) Command(cmd string) *Request
- func (c *Request) Config(conf Config) *Request
- func (c *Request) Conn(ownership ...bool) net.Conn
- func (c *Request) Do(ctx context.Context, body interface{}, hds ...interface{}) error
- func (c *Request) DoNoRes(ctx context.Context, body interface{}, hds ...interface{}) error
- func (c *Request) ReqHeader() *Map
- func (c *Request) Res() error
- func (c *Request) ResBodyBytes() []byte
- func (c *Request) ResBodyJson(bd interface{}) error
- func (c *Request) ResCode() int32
- func (c *Request) ResHeadBytes() []byte
- func (c *Request) ResHeader() (*Map, error)
- func (c *Request) SetArg(k, v string) *Request
- func (c *Request) SetContext(ctx context.Context) *Request
- func (c *Request) Timeout(tmo time.Duration) *Request
- type SliceMock
Constants ¶
View Source
const ( // Status is int32 ResStatusOk int32 = 1 ResStatusErr int32 = 2 ResStatusAuth int32 = 3 ResStatusNotFound int32 = 4 )
Variables ¶
View Source
var Debug = false
Functions ¶
func BigByteToFloat64 ¶
func BigFloatToByte32 ¶
func BigFloatToByte64 ¶
func BigIntToByte ¶
func Byte2Struct ¶
func EndContext ¶
func LitByteToFloat64 ¶
func LitFloatToByte32 ¶
func LitFloatToByte64 ¶
func LitIntToByte ¶
func PathExists ¶
func Struct2Byte ¶
func Struct2ByteLen ¶ added in v1.0.1
Types ¶
type Config ¶
func MakeConfig ¶
func MakeConfig() Config
type ConnFun ¶
type ConnFun func(res *Context)
返回true则连接不会关闭
func GrpcFunHandle ¶
func ParamFunHandle ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func ParseContext ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) NotFoundFun ¶
func (*Engine) RegParamFun ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewConnRequest ¶
func (*Request) ResBodyBytes ¶
func (*Request) ResBodyJson ¶
func (*Request) ResHeadBytes ¶
Click to show internal directories.
Click to hide internal directories.