Versions in this module Expand all Collapse all v1 v1.0.1 May 10, 2021 v1.0.0 May 9, 2021 Changes in this version + var DefaultAddress = ":0" + var DefaultDialTimeout = time.Second * 5 + var DefaultToken = "go.micro.tunnel" + var DiscoverTime = 30 * time.Second + var ErrDecryptingData = errors.New("error decrypting data") + var ErrDialTimeout = errors.New("dial timeout") + var ErrDiscoverChan = errors.New("failed to discover channel") + var ErrLinkConnectTimeout = errors.New("link connect timeout") + var ErrLinkDisconnected = errors.New("link not connected") + var ErrLinkLoopback = errors.New("link is loopback") + var ErrLinkNotFound = errors.New("link not found") + var ErrLinkRemote = errors.New("link is remote") + var ErrReadTimeout = errors.New("read timeout") + var KeepAliveTime = 30 * time.Second + var ReconnectTime = 5 * time.Second + func Decrypt(gcm cipher.AEAD, data []byte) ([]byte, error) + func Encrypt(gcm cipher.AEAD, data []byte) ([]byte, error) + type DialOption func(*DialOptions) + func DialLink(id string) DialOption + func DialMode(m Mode) DialOption + func DialTimeout(t time.Duration) DialOption + func DialWait(b bool) DialOption + type DialOptions struct + Link string + Mode Mode + Timeout time.Duration + Wait bool + type Link interface + Delay func() int64 + Id func() string + Length func() int64 + Loopback func() bool + Rate func() float64 + State func() string + type ListenOption func(*ListenOptions) + func ListenMode(m Mode) ListenOption + func ListenTimeout(t time.Duration) ListenOption + type ListenOptions struct + Mode Mode + Timeout time.Duration + type Listener interface + Accept func() (Session, error) + Channel func() string + Close func() error + type Mode uint8 + const Broadcast + const Multicast + const Unicast + type Option func(*Options) + func Address(a string) Option + func Id(id string) Option + func Nodes(n ...string) Option + func Token(t string) Option + func Transport(t transport.Transport) Option + type Options struct + Address string + Id string + Nodes []string + Token string + Transport transport.Transport + func DefaultOptions() Options + type Session interface + Channel func() string + Id func() string + Link func() string + type Tunnel interface + Address func() string + Close func() error + Connect func() error + Dial func(channel string, opts ...DialOption) (Session, error) + Init func(opts ...Option) error + Links func() []Link + Listen func(channel string, opts ...ListenOption) (Listener, error) + String func() string + func NewTunnel(opts ...Option) Tunnel Incompatible versions in this module v2.3.0+incompatible May 9, 2021