sendworker

package
v1.3.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

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

func Encode(body []byte, headerBytes []byte) []byte

Encode [[magicNum,Length],[codec_version,body_offset,body_length,header_length,header],[body]]

func EncodePreAllocated

func EncodePreAllocated(payload []byte, headerBytes []byte) []byte

EncodePreAllocated [[magicNum,Length],[codec_version,body_offset,body_length,header_length,header],[body]]

func FormatMap

func FormatMap(m map[string]string) []byte

func GetPrefixLen

func GetPrefixLen(version uint8, headerBytes []byte) int

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 SendWorker interface {
	BatchSend([]byte, []byte)
	CloseConn()
}

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()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL