Documentation ¶
Index ¶
- type Config
- type Tunnel
- func (t *Tunnel) Addr() net.Addr
- func (t *Tunnel) Close() error
- func (t *Tunnel) FromAddr() string
- func (t *Tunnel) IsClosed() bool
- func (t *Tunnel) MultiClient() *rvs.MultiClient
- func (t *Tunnel) SetAcceptAddrs(addrsRe *nkngomobile.StringArray) error
- func (t *Tunnel) Start() error
- func (t *Tunnel) ToAddr() string
- func (t *Tunnel) TunaPubAddrs() *ts.PubAddrs
- func (t *Tunnel) TunaSessionClient() *ts.TunaSessionClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { NumSubClients int OriginalClient bool AcceptAddrs *nkngomobile.StringArray ClientConfig *rvs.ClientConfig WalletConfig *rvs.WalletConfig DialConfig *rvs.DialConfig TunaSessionConfig *ts.Config Verbose bool }
func DefaultConfig ¶
func DefaultConfig() *Config
func MergedConfig ¶
type Tunnel ¶
type Tunnel struct {
// contains filtered or unexported fields
}
Tunnel is the tunnel client struct.
func NewTunnel ¶
func NewTunnel(account *rvs.Account, identifier, from, to string, tuna bool, config *Config) (*Tunnel, error)
NewTunnel creates a Tunnel client with given options.
func (*Tunnel) MultiClient ¶
func (t *Tunnel) MultiClient() *rvs.MultiClient
MultiClient returns the NKN multiclient that tunnel creates and uses.
func (*Tunnel) SetAcceptAddrs ¶
func (t *Tunnel) SetAcceptAddrs(addrsRe *nkngomobile.StringArray) error
SetAcceptAddrs updates the accept address regex for incoming sessions. Tunnel will accept sessions from address that matches any of the given regular expressions. If addrsRe is nil, any address will be accepted. Each function call will overwrite previous accept addresses.
func (*Tunnel) TunaPubAddrs ¶
TunaPubAddrs returns the public node info of tuna listeners. Returns nil if there is no tuna listener.
func (*Tunnel) TunaSessionClient ¶
func (t *Tunnel) TunaSessionClient() *ts.TunaSessionClient
TunaSessionClient returns the tuna session client that tunnel creates and uses. It is not nil only if tunnel is created with tuna == true.