packet

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 2 Imported by: 13 modules, 16 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Compress bool `json:"compress" msgpack:"compress"`
	// Deprecated: this method will be removed in the next major release, please use [Options.WsPreEncodedFrame] instead.
	WsPreEncoded      types.BufferInterface
	WsPreEncodedFrame types.BufferInterface `json:"wsPreEncodedFrame,omitempty" msgpack:"wsPreEncodedFrame,omitempty"`
}

type Packet

type Packet struct {
	Type    Type      `json:"type" msgpack:"type"`
	Data    io.Reader `json:"data,omitempty" msgpack:"data,omitempty"`
	Options *Options  `json:"options,omitempty" msgpack:"options,omitempty"`

	// Deprecated: this method will be removed in the next major release, please use [Options.WsPreEncodedFrame] instead.
	WsPreEncoded types.BufferInterface
}

type Type

type Type string
const (
	OPEN    Type = "open"
	CLOSE   Type = "close"
	PING    Type = "ping"
	PONG    Type = "pong"
	MESSAGE Type = "message"
	UPGRADE Type = "upgrade"
	NOOP    Type = "noop"
	ERROR   Type = "error"
)

Packet types.

Jump to

Keyboard shortcuts

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