codec

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NameIsNullError = errors.New("name is ''")
	DataDecodeError = errors.New("data decode error")
)

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Encode
	Decode
}

type Decode

type Decode interface {
	Decode(data []byte) (m message.Message, err error)
}

type Encode

type Encode interface {
	Encode(m message.Message) (data []byte, err error)
}

type VNDCodec added in v0.1.1

type VNDCodec struct {
}

VNDCodec 版本域(Version)+ 名域(Name) + 数据域(Data) ┌───────┬───────┬───────┬────────────────┐ │version│ retry │ length│ name │ header ├───────┴───────┴───────┴────────────────┤ │ body │ └────────────────────────────────────────┘

func (*VNDCodec) Decode added in v0.1.1

func (c *VNDCodec) Decode(data []byte) (m message.Message, err error)

func (*VNDCodec) Encode added in v0.1.1

func (c *VNDCodec) Encode(m message.Message) (data []byte, err error)

Jump to

Keyboard shortcuts

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