Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SliceByteToString ¶
func StringToSliceByte ¶
Types ¶
type Header ¶
type Header [headerLen]byte
func (*Header) MessageStatusType ¶
func (h *Header) MessageStatusType() MessageStatusType
MessageStatusType returns the message status type.
func (*Header) SerializeType ¶
func (h *Header) SerializeType() SerializeType
SerializeType returns serialization type of payload.
func (*Header) SetMessageStatusType ¶
func (h *Header) SetMessageStatusType(mt MessageStatusType)
SetMessageStatusType sets message status type.
func (*Header) SetSerializeType ¶
func (h *Header) SetSerializeType(st SerializeType)
SetSerializeType sets the serialization type.
type Message ¶
type Message struct { *Header ServicePath string ServiceMethod string Payload []byte // contains filtered or unexported fields }
func GetPooledMsg ¶ added in v0.5.0
func GetPooledMsg() *Message
GetPooledMsg gets a pooled message.
func NewMessage ¶
func NewMessage() *Message
type MessageStatusType ¶
type MessageStatusType byte
MessageStatusType is status of messages.
const ( // Normal is normal requests and responses. Normal MessageStatusType = iota // Error indicates some errors occur. Error )
type SerializeType ¶
type SerializeType byte
SerializeType defines serialization type of payload.
const ( // SerializeNone uses raw []byte and don't serialize/deserialize SerializeNone SerializeType = iota // JSON for payload. JSON // ProtoBuffer for payload. ProtoBuffer // MsgPack for payload MsgPack )
Click to show internal directories.
Click to hide internal directories.