v4

package
v0.0.0-...-120cf50 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MsgLenLen int = 2
View Source
const MsgOpcodeLen int = 4
View Source
const MsgRecvLenLen int = 2
View Source
const MsgSenderLen int = 8
View Source
const VERSION string = "4.0.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec struct{}

编解码器

func NewCodec

func NewCodec() *Codec

func (*Codec) Format

func (c *Codec) Format(arg interface{}) ([]byte, error)

格式化

func (*Codec) GetContentData

func (c *Codec) GetContentData(data []byte) []byte

获得内容二进制

func (*Codec) ParseContent

func (c *Codec) ParseContent(data []byte, content interface{}) error

解析内容

func (*Codec) ParseOpCode

func (c *Codec) ParseOpCode(data []byte) (uint32, error)

解析opcode

func (*Codec) ParseRecv

func (c *Codec) ParseRecv(data []byte) ([]uint64, error)

解析收信人名单

func (*Codec) ParseRecvLen

func (c *Codec) ParseRecvLen(data []byte) (uint16, error)

解析收信人名单长度

func (*Codec) ParseSender

func (c *Codec) ParseSender(data []byte) (uint64, error)

解析发送者

func (*Codec) ParseTotalLen

func (c *Codec) ParseTotalLen(data []byte) (uint16, error)

解析总长

func (*Codec) UnFormat

func (c *Codec) UnFormat(data []byte, arg interface{}) error

反格式化

func (*Codec) Version

func (c *Codec) Version() string

版本

type Messager

type Messager struct {
	OpCode   uint32
	Receiver []uint64
	Sender   uint64
	Content  interface{}
}

消息体

func (*Messager) Version

func (m *Messager) Version() string

版本

Jump to

Keyboard shortcuts

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