transport

package
v0.0.0-...-0eaabd3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = 5 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn io.ReadWriteCloser

func NewTCP

func NewTCP(cfg TCPConnConfig) (Conn, error)

type ConnConfig

type ConnConfig interface{}

type ErrCode

type ErrCode int64

func (ErrCode) Error

func (e ErrCode) Error() string

type ErrNotMultiple

type ErrNotMultiple struct {
	Len int
}

func (*ErrNotMultiple) Error

func (e *ErrNotMultiple) Error() string

type Mode

type Mode interface {
	WriteMsg(msg []byte) error // this is not same as the io.Writer
	ReadMsg() ([]byte, error)
}

type ModeConfig

type ModeConfig = func(Conn) (Mode, error)

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is a wrapper around io.Reader, that allows to cancel read operation.

func NewReader

func NewReader(ctx context.Context, r io.Reader) *Reader

func (*Reader) Read

func (c *Reader) Read(p []byte) (int, error)

func (*Reader) ReadByte

func (c *Reader) ReadByte() (byte, error)

type TCPConnConfig

type TCPConnConfig struct {
	Ctx     context.Context
	Host    string
	Timeout time.Duration
	Socks   *url.URL
}

type Transport

type Transport interface {
	Close() error
	WriteMsg(msg messages.Common, seqNo int32) error
	ReadMsg() (messages.Common, error)
}

func NewTransport

func NewTransport(m messages.MessageInformator, conn ConnConfig, modeVariant mode.Variant) (Transport, error)

Jump to

Keyboard shortcuts

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