Documentation
¶
Index ¶
- Constants
- func EncodeReq(writer netpoll.Writer, req *ReqPack) (err error)
- func PutPayloadCode(name string, v PayloadCodec)
- func WriteResp(writer netpoll.Writer, msg *RespPack) (err error)
- func WriteStringToBuf(buffer *bytes.Buffer, b []byte) error
- type Addr
- type PayloadCodec
- type ReqPack
- type RespPack
- type RetType
Constants ¶
View Source
const (
PartSize int = 0x8000
)
Variables ¶
This section is empty.
Functions ¶
func PutPayloadCode ¶
func PutPayloadCode(name string, v PayloadCodec)
PutPayloadCode puts the desired payload codec to message.
Types ¶
type Addr ¶
func GetServiceAddress ¶
type PayloadCodec ¶
type PayloadCodec interface {
Marshal(msg any) ([]byte, error)
Unmarshal(in []byte, msg any) error
IsNull(in []byte) bool
Name() string
}
func GetPayloadCodec ¶
func GetPayloadCodec(name string) (PayloadCodec, bool)
default registered json/msgpack GetPayloadCodec gets desired payload codec from name.
type ReqPack ¶
type ReqPack struct {
Addr Addr // 4-7
Session uint32 // 8-11
Push bool // push package don't need to response
Method string
Payload []byte
}
Click to show internal directories.
Click to hide internal directories.