transport

package
v0.17.20 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWsWriteTimeout      = time.Second * 10
	DefaultWsReadTimeout       = time.Second * 5
	DefaultWsIdleTimeout       = time.Second * 5
	DefaultWsPongTimeout       = time.Second * 60
	DefaultWsPingInterval      = (DefaultWsPongTimeout * 9) / 10
	DefaultWsHandshakeTimeout  = time.Second * 10
	DefaultWsReadBufferSize    = 4096
	DefaultWsWriteBufferSize   = 4096
	DefaultWsEnableCompression = true
)

Variables

This section is empty.

Functions

func AddAddressParser

func AddAddressParser(addressParser AddressParser)

AddAddressParser adds an AddressParser to the globally-configured address parsers.

Types

type Address

type Address interface {
	Dial(name string, i *identity.TokenId, timeout time.Duration, tcfg Configuration) (Connection, error)
	Listen(name string, i *identity.TokenId, incoming chan Connection, tcfg Configuration) (io.Closer, error)
	MustListen(name string, i *identity.TokenId, incoming chan Connection, tcfg Configuration) io.Closer
	String() string
	Type() string
}

Address implements the functionality provided by a generic "address".

func ParseAddress

func ParseAddress(addressString string) (Address, error)

ParseAddress uses the globally-configured AddressParser instances to parse an address.

type AddressParser

type AddressParser interface {
	Parse(addressString string) (Address, error)
}

AddressParser implements the functionality provided by an "address parser".

type Configuration added in v0.11.17

type Configuration map[interface{}]interface{}

type Connection

type Connection interface {
	Detail() *ConnectionDetail
	PeerCertificates() []*x509.Certificate
	Reader() io.Reader
	Writer() io.Writer
	Conn() net.Conn
	SetReadTimeout(t time.Duration) error
	ClearReadTimeout() error
	SetWriteTimeout(t time.Duration) error
	ClearWriteTimeout() error
	io.Closer
}

Connection represents an abstract connection (ingress or egress).

type ConnectionDetail

type ConnectionDetail struct {
	Address string
	InBound bool
	Name    string
}

func (*ConnectionDetail) String

func (cd *ConnectionDetail) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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