transport

package
v1.0.1-0...-a77bf53 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 int

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 TCPConnConfig

type TCPConnConfig struct {
	Ctx     context.Context
	Host    string
	Timeout time.Duration
}

type Transport

type Transport interface {
	Close() error
	WriteMsg(msg messages.Common, requireToAck bool) 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