packet

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	IDKick = iota
	IDTransfer
)

Variables

This section is empty.

Functions

func Register

func Register(id uint32, factory func() Packet)

Types

type Kick

type Kick struct {
	Reason   string
	Username string
}

func (*Kick) Decode

func (k *Kick) Decode(buf *bytes.Buffer)

Decode ...

func (*Kick) Encode

func (k *Kick) Encode(buf *bytes.Buffer)

Encode ...

func (*Kick) ID

func (k *Kick) ID() uint32

ID ...

type Packet

type Packet interface {
	ID() uint32
	Encode(buf *bytes.Buffer)
	Decode(buf *bytes.Buffer)
}

Packet ...

type Pool

type Pool map[uint32]func() Packet

func NewPool

func NewPool() Pool

type Transfer

type Transfer struct {
	Addr     string
	Username string
}

func (*Transfer) Decode

func (t *Transfer) Decode(buf *bytes.Buffer)

Decode ...

func (*Transfer) Encode

func (t *Transfer) Encode(buf *bytes.Buffer)

Encode ...

func (*Transfer) ID

func (t *Transfer) ID() uint32

ID ...

Jump to

Keyboard shortcuts

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