types

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodePacket

func DecodePacket(r []byte, auth Auth, prefix bool) ([]byte, netapi.Address, error)

func EncodePacket

func EncodePacket(w PacketBuffer, addr net.Addr, buf []byte, auth Auth, prefix bool) error

func Salt

func Salt(password []byte) []byte

Types

type Aead

type Aead interface {
	New([]byte) (cipher.AEAD, error)
	KeySize() int
	NonceSize() int
	Name() []byte
}

type Auth

type Auth interface {
	cipher.AEAD
	KeySize() int
	Key() []byte
}

type Buffer

type Buffer interface {
	Len() int
	Bytes() []byte
	Write(b []byte) (int, error)
	WriteByte(b byte) error
}

type Handshaker

type Handshaker interface {
	Handshake(net.Conn) (net.Conn, error)
	EncodeHeader(Protocol, Buffer, netapi.Address)
	DecodeHeader(net.Conn) (Protocol, error)
}

type Hash

type Hash interface {
	New() hash.Hash
	Size() int
}

type PacketBuffer

type PacketBuffer interface {
	Buffer
	Advance(int)
}

type Protocol

type Protocol byte
var (
	TCP Protocol = 66
	UDP Protocol = 77
)

func (Protocol) Unknown

func (n Protocol) Unknown() bool

type Signer

type Signer interface {
	Sign(rand io.Reader, digest []byte) (signature []byte, err error)
	SignatureSize() int
	Verify(message, sig []byte) bool
}

Jump to

Keyboard shortcuts

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