transport

package module
v2.0.153 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 11 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 (
	KeyProxy                    = "proxy"
	KeyProtocol                 = "protocol"
	KeyCachedProxyConfiguration = "cachedProxyConfiguration"

	KeyHandshakeTimeout       = "handshakeTimeout"
	KeyCachedHandshakeTimeout = "cachedHandshakeTimeout"
)
View Source
const (
	DefaultWsWriteTimeout      = time.Second * 10
	DefaultWsReadTimeout       = time.Second * 5
	DefaultWsIdleTimeout       = time.Second * 120
	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{}

func (Configuration) GetHandshakeTimeout added in v2.0.143

func (self Configuration) GetHandshakeTimeout() (time.Duration, error)

func (Configuration) GetInt64Value added in v2.0.145

func (self Configuration) GetInt64Value(first string, rest ...string) (int64, bool, error)

func (Configuration) GetProxyConfiguration added in v2.0.100

func (self Configuration) GetProxyConfiguration() (*ProxyConfiguration, error)

func (Configuration) GetUIntValue added in v2.0.145

func (self Configuration) GetUIntValue(first string, rest ...string) (uint, bool, error)

func (Configuration) GetValue added in v2.0.145

func (self Configuration) GetValue(first string, rest ...string) (interface{}, error)

func (Configuration) Protocols added in v2.0.95

func (self Configuration) Protocols() []string

Protocols returns supported or requested application protocols (used for ALPN support)

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

type HostPortAddress added in v2.0.94

type HostPortAddress interface {
	Address
	Hostname() string
	Port() uint16
}

type ProxyConfiguration added in v2.0.100

type ProxyConfiguration struct {
	Type    ProxyType
	Address string
	Auth    *proxy.Auth
}

func LoadProxyConfiguration added in v2.0.100

func LoadProxyConfiguration(cfg map[interface{}]interface{}) (*ProxyConfiguration, error)

type ProxyType added in v2.0.100

type ProxyType string
const (
	ProxyTypeNone        ProxyType = "none"
	ProxyTypeHttpConnect ProxyType = "http"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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