packets

package
v0.0.0-...-94e82ac Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownPacket = errors.New("unknown packet")

Functions

func Marshal

func Marshal(packet Packet) []byte

func Send

func Send(ctx context.Context, dc *ctxwebrtc.DataChannel, packet Packet) error

Types

type Commit

type Commit struct {
	Commitment [32]uint8
}

type Intent

type Intent struct {
	ForTick uint32
	Intent  state.Intent
}

type Packet

type Packet interface {
	// contains filtered or unexported methods
}

func Recv

func Recv(ctx context.Context, dc *ctxwebrtc.DataChannel) (Packet, error)

func Unmarshal

func Unmarshal(raw []byte) (Packet, error)

type Ping

type Ping struct {
	ID uint64
}

type Pong

type Pong struct {
	ID uint64
}

type Reveal

type Reveal struct {
	Nonce [16]uint8
}

Jump to

Keyboard shortcuts

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