messager

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 MsgHeadLen int = 6
View Source
const MsgIdLen int = 4
View Source
const MsgLenLen int = 2
View Source
const VERSION = "3.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) ParseId

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

解析id

func (*Codec) ParseLen

func (c *Codec) ParseLen(data []byte) (int, 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 {
	Content proto.Message //内容
	Id      uint32        //id
}

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