conntypes

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionProtocolIPv4 ConnectionProtocol = 1
	ConnectionProtocolIPv6                    = ConnectionProtocolIPv4 << 1
	ConnectionProtocolAny                     = ConnectionProtocolIPv4 | ConnectionProtocolIPv6
)
View Source
const ConnIDLength = 8

Variables

View Source
var (
	ConnectionTagAbridged     = []byte{0xef, 0xef, 0xef, 0xef}
	ConnectionTagIntermediate = []byte{0xee, 0xee, 0xee, 0xee}
	ConnectionTagSecure       = []byte{0xdd, 0xdd, 0xdd, 0xdd}
)

Functions

This section is empty.

Types

type BasePacketReader

type BasePacketReader interface {
	Read() (Packet, error)
}

type BasePacketWriter

type BasePacketWriter interface {
	Write(Packet) error
}

type BaseStreamReaderWithTimeout

type BaseStreamReaderWithTimeout interface {
	ReadTimeout([]byte, time.Duration) (int, error)
}

type BaseStreamWriterWithTimeout

type BaseStreamWriterWithTimeout interface {
	WriteTimeout([]byte, time.Duration) (int, error)
}

type ConnID

type ConnID [ConnIDLength]byte

func NewConnID

func NewConnID() ConnID

func (ConnID) String

func (c ConnID) String() string

type ConnectionAcks

type ConnectionAcks struct {
	Simple bool
	Quick  bool
}

type ConnectionProtocol

type ConnectionProtocol uint8

func (ConnectionProtocol) String

func (c ConnectionProtocol) String() string

type ConnectionType

type ConnectionType uint8
const (
	ConnectionTypeUnknown ConnectionType = iota
	ConnectionTypeAbridged
	ConnectionTypeIntermediate
	ConnectionTypeSecure
)

func (ConnectionType) Tag

func (t ConnectionType) Tag() []byte

type DC

type DC int16
const DCDefaultIdx DC = 1

type Packet

type Packet []byte

type PacketAckCloser

type PacketAckCloser interface {
	io.Closer
}

type PacketAckFullReadWriteCloser

type PacketAckFullReadWriteCloser interface {
	Wrap
	PacketAckReadWriteCloser
}

type PacketAckReadCloser

type PacketAckReadCloser interface {
	PacketAckReader
	PacketAckCloser
}

type PacketAckReadWriteCloser

type PacketAckReadWriteCloser interface {
	PacketAckReader
	PacketAckWriter
	PacketAckCloser
}

type PacketAckReadWriter

type PacketAckReadWriter interface {
	PacketAckReader
	PacketAckWriter
}

type PacketAckReader

type PacketAckReader interface {
	Read(*ConnectionAcks) (Packet, error)
}

type PacketAckWriteCloser

type PacketAckWriteCloser interface {
	PacketAckWriter
	PacketAckCloser
}

type PacketAckWriter

type PacketAckWriter interface {
	Write(Packet, *ConnectionAcks) error
}

type PacketCloser

type PacketCloser interface {
	Wrap
	io.Closer
}

type PacketReadCloser

type PacketReadCloser interface {
	Wrap
	BasePacketReader
	io.Closer
}

type PacketReadWriteCloser

type PacketReadWriteCloser interface {
	Wrap
	BasePacketWriter
	BasePacketReader
	io.Closer
}

type PacketReadWriter

type PacketReadWriter interface {
	Wrap
	BasePacketWriter
	BasePacketReader
}

type PacketReader

type PacketReader interface {
	Wrap
	BasePacketReader
}

type PacketWriteCloser

type PacketWriteCloser interface {
	Wrap
	BasePacketWriter
	io.Closer
}

type PacketWriter

type PacketWriter interface {
	Wrap
	BasePacketWriter
}

type StreamCloser

type StreamCloser interface {
	Wrap
	io.Closer
}

type StreamReadCloser

type StreamReadCloser interface {
	Wrap
	io.ReadCloser
	BaseStreamReaderWithTimeout
}

type StreamReadWriter

type StreamReadWriter interface {
	Wrap
	io.ReadWriter
	BaseStreamReaderWithTimeout
}

type StreamReader

type StreamReader interface {
	Wrap
	io.Reader
	BaseStreamReaderWithTimeout
}

type StreamWriteCloser

type StreamWriteCloser interface {
	Wrap
	io.WriteCloser
	BaseStreamWriterWithTimeout
}

type StreamWriter

type StreamWriter interface {
	Wrap
	io.Writer
	BaseStreamWriterWithTimeout
}

type Wrap

type Wrap interface {
	Conn() net.Conn
	Logger() *zap.SugaredLogger
	LocalAddr() *net.TCPAddr
	RemoteAddr() *net.TCPAddr
}

Jump to

Keyboard shortcuts

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