Versions in this module Expand all Collapse all v1 v1.0.0 Aug 18, 2021 Changes in this version + var DefaultAddress = ":0" + var DefaultDialTimeout = time.Second * 5 + var DefaultToken = "go.micro.tunnel" + var DiscoverTime = 60 * time.Second + var ErrDialTimeout = errors.New("dial timeout") + var ErrDiscoverChan = errors.New("failed to discover channel") + var ErrLinkConnectTimeout = errors.New("link connect timeout") + var ErrLinkNotFound = errors.New("link not found") + var ErrReadTimeout = errors.New("read timeout") + var KeepAliveTime = 30 * time.Second + var ReconnectTime = 5 * time.Second + func Decrypt(data []byte, key string) ([]byte, error) + func Encrypt(data []byte, key string) ([]byte, error) + type DialOption func(*DialOptions) + func DialLink(id string) DialOption + func DialMode(m Mode) DialOption + func DialTimeout(t time.Duration) DialOption + type DialOptions struct + Link string + Mode Mode + Timeout time.Duration + 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