Documentation ¶
Index ¶
- Constants
- func DefaultSessionConfig() *ncp.Config
- type Config
- type Conn
- type DialConfig
- 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 *DialConfig) (*ncp.Session, error)
- func (c *TunaSessionClient) GetPubAddrs() *PubAddrs
- func (c *TunaSessionClient) IsClosed() bool
- func (c *TunaSessionClient) Listen(addrsRe *nkn.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 = nkn.DefaultSessionAllowAddr SessionIDSize = nkn.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 TunaServiceName string TunaSubscriptionPrefix string TunaIPFilter *geo.IPFilter TunaDownloadGeoDB bool TunaGeoDBPath string TunaMeasureBandwidth bool TunaMeasureStoragePath string SessionConfig *ncp.Config }
func DefaultConfig ¶
func DefaultConfig() *Config
func MergedConfig ¶
type DialConfig ¶
func DefaultDialConfig ¶
func DefaultDialConfig(baseSessionConfig *ncp.Config) *DialConfig
func MergeDialConfig ¶
func MergeDialConfig(baseSessionConfig *ncp.Config, conf *DialConfig) (*DialConfig, error)
type TunaSessionClient ¶
func NewTunaSessionClient ¶
func NewTunaSessionClient(clientAccount *nkn.Account, m *nkn.MultiClient, wallet *nkn.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 *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 *nkn.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.