framing

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const FrameLengthFieldSize = 3

Variables

This section is empty.

Functions

func ReadFrameLength

func ReadFrameLength(buf []byte) (int, []byte)

ReadFrameLength reads frame length from bytes and returns the clean buf.

Types

type Frame

type Frame interface {
	// Bytes converts the frame to bytes
	Bytes() []byte
}

Frame represents a YoMo frame.

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Frame Length               |
+-----------------------------------------------+
|                     Frame                     |
|                                               |
+-----------------------------------------------+

type PayloadFrame

type PayloadFrame struct {
	// contains filtered or unexported fields
}

PayloadFrame represents a payload frame.

func NewPayloadFrame

func NewPayloadFrame(data []byte) *PayloadFrame

NewPayloadFrame inits a new PayloadFrame.

func (*PayloadFrame) Bytes

func (p *PayloadFrame) Bytes() []byte

Bytes get the bytes of PayloadFrame.

Jump to

Keyboard shortcuts

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