protobuf

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackMessage

func PackMessage(msgType string, data []byte) []byte

PackMessage 按自定义协议打包数据

Types

type Message

type Message struct {
	Len     uint32
	TypeLen uint16
	Type    string
	Data    []byte
}

Message 数据帧定义

type Protocol

type Protocol struct {
}

Protocol protobuf

func New

func New() *Protocol

New 创建 protobuf Protocol

func (*Protocol) Packet

func (p *Protocol) Packet(c *gev.Connection, data interface{}) []byte

Packet ...

func (*Protocol) UnPacket

func (p *Protocol) UnPacket(c *gev.Connection, buffer *ringbuffer.RingBuffer) (ctx interface{}, out []byte)

UnPacket ...

Jump to

Keyboard shortcuts

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