Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConnectionMagicNum = uint16(31843) Version1 = uint8(1) CommonPrefixLen = 6 // magicNum 2byte + Length 4Byte Version1DataPrefixLen = 13 //prefix len of version 1, not including magicNum and Length filed )
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
Encode [[magicNum,Length],[codec_version,body_offset,body_length,header_length,header],[body]]
func EncodePreAllocated ¶
EncodePreAllocated [[magicNum,Length],[codec_version,body_offset,body_length,header_length,header],[body]]
func GetPrefixLen ¶
Types ¶
type DatagramWorker ¶
type DatagramWorker struct {
// contains filtered or unexported fields
}
func NewDatagramWorker ¶
func NewDatagramWorker(msgType, sock string, l logger.Logger) *DatagramWorker
func (*DatagramWorker) BatchSend ¶
func (w *DatagramWorker) BatchSend(data []byte, _ []byte)
func (*DatagramWorker) CloseConn ¶
func (w *DatagramWorker) CloseConn()
type SendWorker ¶
type StreamWorker ¶
type StreamWorker struct {
// contains filtered or unexported fields
}
func NewStreamWorker ¶
func NewStreamWorker(msgType, sock string, l logger.Logger) *StreamWorker
func (*StreamWorker) BatchSend ¶
func (w *StreamWorker) BatchSend(data []byte, tags []byte)
func (*StreamWorker) CloseConn ¶
func (w *StreamWorker) CloseConn()
Click to show internal directories.
Click to hide internal directories.