transport

package module
v2.0.44 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 55

README

Ziti Transport Library

This library provides connection abstractions which are bundled with an identity. The identity generally has certificates.

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.

func NewDialerWithLocalBinding

func NewDialerWithLocalBinding(addressType string, timeout time.Duration, localBinding string) (*net.Dialer, error)

NewDialerWithLocalBinding creates a dialer and sets the local ip used for dialing

func ResolveInterface

func ResolveInterface(toResolve string) (*net.Interface, error)

Resolve a network interface by name or IP address

func ResolveLocalBinding

func ResolveLocalBinding(localBinding string) (net.IP, error)

Types

type Address

type Address interface {
	Dial(name string, i *identity.TokenId, timeout time.Duration, tcfg Configuration) (Conn, error)
	DialWithLocalBinding(name string, binding string, i *identity.TokenId, timeout time.Duration, tcfg Configuration) (Conn, error)
	Listen(name string, i *identity.TokenId, acceptF func(Conn), tcfg Configuration) (io.Closer, error)
	MustListen(name string, i *identity.TokenId, acceptF func(Conn), 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

type Configuration map[interface{}]interface{}

type Conn

type Conn interface {
	Detail() *ConnectionDetail
	PeerCertificates() []*x509.Certificate
	net.Conn
}

Conn represents an abstract connection

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