Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeBody(body []byte, i interface{}) error
- func Encode(header *Header, i interface{}) ([]byte, error)
- func EncodeBody(i interface{}) ([]byte, error)
- func EncodeHeader(header *Header) ([]byte, error)
- func Write(conn net.Conn, header *Header, i interface{}) error
- type Command1Req
- type Command1Rsp
- type Command2Req
- type Command2Rsp
- type Header
- type OpType
Constants ¶
View Source
const HeaderLength = 25
HeaderLength header packet length
Variables ¶
View Source
var ( ErrHeaderIsNil = errors.New("heaser is nil") ErrPkgNoEnough = errors.New("pkg no enough") )
errors
Functions ¶
func EncodeHeader ¶
EncodeHeader encode the header use network byte order
Types ¶
type Command1Req ¶
type Command1Req struct {
Name string
}
type Command1Rsp ¶
type Command2Req ¶
type Command2Rsp ¶
Click to show internal directories.
Click to hide internal directories.