Documentation ¶
Index ¶
- Constants
- func DefaultSessionConfig() *ncp.Config
- type Config
- type Conn
- type PubAddr
- type PubAddrs
- type Request
- type TunaSessionClient
- func (c *TunaSessionClient) Accept() (net.Conn, error)
- func (c *TunaSessionClient) AcceptSession() (*ncp.Session, error)
- func (c *TunaSessionClient) Addr() net.Addr
- func (c *TunaSessionClient) Address() string
- func (c *TunaSessionClient) Close() error
- func (c *TunaSessionClient) Dial(remoteAddr string) (net.Conn, error)
- func (c *TunaSessionClient) DialSession(remoteAddr string) (*ncp.Session, error)
- func (c *TunaSessionClient) DialWithConfig(remoteAddr string, config *rvs.DialConfig) (*ncp.Session, error)
- func (c *TunaSessionClient) GetPubAddrs() *PubAddrs
- func (c *TunaSessionClient) IsClosed() bool
- func (c *TunaSessionClient) Listen(addrsRe *nkngomobile.StringArray) error
- func (c *TunaSessionClient) RotateAll() error
- func (c *TunaSessionClient) RotateOne(i int) error
- func (c *TunaSessionClient) SetConfig(conf *Config) error
Constants ¶
View Source
const ( DefaultSessionAllowAddr = rvs.DefaultSessionAllowAddr SessionIDSize = rvs.SessionIDSize )
Variables ¶
This section is empty.
Functions ¶
func DefaultSessionConfig ¶
Types ¶
type Config ¶
type Config struct { NumTunaListeners int TunaDialTimeout int // in millisecond TunaMaxPrice string TunaNanoPayFee string TunaMinNanoPayFee string TunaNanoPayFeeRatio float64 TunaServiceName string TunaSubscriptionPrefix string TunaIPFilter *geo.IPFilter TunaNknFilter *filter.NknFilter TunaDownloadGeoDB bool TunaGeoDBPath string TunaMeasureBandwidth bool TunaMeasureStoragePath string SessionConfig *ncp.Config }
func DefaultConfig ¶
func DefaultConfig() *Config
func MergedConfig ¶
type TunaSessionClient ¶
func NewTunaSessionClient ¶
func NewTunaSessionClient(clientAccount *rvs.Account, m *rvs.MultiClient, wallet *rvs.Wallet, config *Config) (*TunaSessionClient, error)
func (*TunaSessionClient) AcceptSession ¶
func (c *TunaSessionClient) AcceptSession() (*ncp.Session, error)
func (*TunaSessionClient) Addr ¶
func (c *TunaSessionClient) Addr() net.Addr
func (*TunaSessionClient) Address ¶
func (c *TunaSessionClient) Address() string
func (*TunaSessionClient) Close ¶
func (c *TunaSessionClient) Close() error
func (*TunaSessionClient) Dial ¶
func (c *TunaSessionClient) Dial(remoteAddr string) (net.Conn, error)
func (*TunaSessionClient) DialSession ¶
func (c *TunaSessionClient) DialSession(remoteAddr string) (*ncp.Session, error)
func (*TunaSessionClient) DialWithConfig ¶
func (c *TunaSessionClient) DialWithConfig(remoteAddr string, config *rvs.DialConfig) (*ncp.Session, error)
func (*TunaSessionClient) GetPubAddrs ¶
func (c *TunaSessionClient) GetPubAddrs() *PubAddrs
func (*TunaSessionClient) IsClosed ¶
func (c *TunaSessionClient) IsClosed() bool
func (*TunaSessionClient) Listen ¶
func (c *TunaSessionClient) Listen(addrsRe *nkngomobile.StringArray) error
func (*TunaSessionClient) RotateAll ¶
func (c *TunaSessionClient) RotateAll() error
RotateOne create and replace all tuna exit. New connections accepted will use new tuna exit, existing connections will not be affected.
func (*TunaSessionClient) RotateOne ¶
func (c *TunaSessionClient) RotateOne(i int) error
RotateOne create a new tuna exit and replace the i-th one. New connections accepted will use new tuna exit, existing connections will not be affected.
func (*TunaSessionClient) SetConfig ¶
func (c *TunaSessionClient) SetConfig(conf *Config) error
SetConfig will set any non-empty value in conf to tuna session config.
Click to show internal directories.
Click to hide internal directories.