packer

package
v0.0.0-...-63b2ac5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentTyper

type ContentTyper interface {
	ContentType() string
}

type Packer

type Packer interface {
	//
	Pack(rw io.Writer, payload Payloader) error
	//
	UnPack(r io.Reader) (Payloader, error)
}

消息编解码器

type Payloader

type Payloader interface {
	// 数据类型
	Type() ContentTyper

	// 数据 head
	Head() []byte

	// 数据
	Payload() []byte
}

编解码包,根据 reader和writer来实现.,网络层面可以实现 使用超时机制控制的,和结束字符控制的,和长度控制的

Jump to

Keyboard shortcuts

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