Back to godoc.org

Package conntypes

v1.0.7
Latest Go to latest

The highest tagged major version is .

Published: Sep 21, 2020 | License: MIT | Module: github.com/9seconds/mtg

Index

Constants

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

Variables

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

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
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier