transport

package
v0.0.0-...-ecf2efd Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 13 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