codec

package
v0.0.0-...-41dda67 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MessageLenErr = errors.New("message len err")

Functions

func Set

func Set(codec Codec)

Types

type Codec

type Codec interface {
	Encode(m *Message) ([]byte, error)
	Decode(data []byte) (*Message, error)
}

func Get

func Get() Codec

type Message

type Message struct {
	Route   string
	Payload []byte
}

func NewMessage

func NewMessage(route string, payload []byte) *Message

Jump to

Keyboard shortcuts

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