Documentation ¶
Index ¶
- type Auth
- type Client
- func (c *Client) OnUpdatedHostDNS(list *DNSList) error
- func (c *Client) PeersList() *PeerInfoArray
- func (c *Client) RemoveConnectionListener()
- func (c *Client) Run(urlOpener URLOpener, dns *DNSList, dnsReadyListener DnsReadyListener) error
- func (c *Client) RunWithoutLogin(dns *DNSList, dnsReadyListener DnsReadyListener) error
- func (c *Client) SetConnectionListener(listener ConnectionListener)
- func (c *Client) SetTraceLogLevel()
- func (c *Client) Stop()
- type ConnectionListener
- type DNSList
- type DnsReadyListener
- type ErrListener
- type IFaceDiscover
- type PeerInfo
- type PeerInfoArray
- type PeerInfoCollection
- type Preferences
- func (p *Preferences) Commit() error
- func (p *Preferences) GetAdminURL() (string, error)
- func (p *Preferences) GetManagementURL() (string, error)
- func (p *Preferences) GetPreSharedKey() (string, error)
- func (p *Preferences) SetAdminURL(url string)
- func (p *Preferences) SetManagementURL(url string)
- func (p *Preferences) SetPreSharedKey(key string)
- type RouteListener
- type SSOListener
- type TunAdapter
- type URLOpener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth can register or login new client
func NewAuthWithConfig ¶
NewAuthWithConfig instantiate Auth based on existing config
func (*Auth) Login ¶
func (a *Auth) Login(resultListener ErrListener, urlOpener URLOpener)
Login try register the client on the server
func (*Auth) LoginWithSetupKeyAndSaveConfig ¶
func (a *Auth) LoginWithSetupKeyAndSaveConfig(resultListener ErrListener, setupKey string, deviceName string)
LoginWithSetupKeyAndSaveConfig test the connectivity with the management server with the setup key.
func (*Auth) SaveConfigIfSSOSupported ¶
func (a *Auth) SaveConfigIfSSOSupported(listener SSOListener)
SaveConfigIfSSOSupported test the connectivity with the management server by retrieving the server device flow info. If it returns a flow info than save the configuration and return true. If it gets a codes.NotFound, it means that SSO is not supported and returns false without saving the configuration. For other errors return false.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct manage the life circle of background service
func NewClient ¶
func NewClient(cfgFile, deviceName string, tunAdapter TunAdapter, iFaceDiscover IFaceDiscover, routeListener RouteListener) *Client
NewClient instantiate a new Client
func (*Client) OnUpdatedHostDNS ¶ added in v0.21.9
OnUpdatedHostDNS update the DNS servers addresses for root zones
func (*Client) PeersList ¶
func (c *Client) PeersList() *PeerInfoArray
PeersList return with the list of the PeerInfos
func (*Client) RemoveConnectionListener ¶
func (c *Client) RemoveConnectionListener()
RemoveConnectionListener remove connection listener
func (*Client) Run ¶
func (c *Client) Run(urlOpener URLOpener, dns *DNSList, dnsReadyListener DnsReadyListener) error
Run start the internal client. It is a blocker function
func (*Client) RunWithoutLogin ¶ added in v0.22.4
func (c *Client) RunWithoutLogin(dns *DNSList, dnsReadyListener DnsReadyListener) error
RunWithoutLogin we apply this type of run function when the backed has been started without UI (i.e. after reboot). In this case make no sense handle registration steps.
func (*Client) SetConnectionListener ¶ added in v0.15.0
func (c *Client) SetConnectionListener(listener ConnectionListener)
SetConnectionListener set the network connection listener
func (*Client) SetTraceLogLevel ¶ added in v0.21.2
func (c *Client) SetTraceLogLevel()
SetTraceLogLevel configure the logger to trace level
type ConnectionListener ¶
ConnectionListener export internal Listener for mobile
type DNSList ¶ added in v0.21.9
type DNSList struct {
// contains filtered or unexported fields
}
DNSList is a wrapper of []string
type DnsReadyListener ¶ added in v0.21.9
type DnsReadyListener interface { dns.ReadyListener }
DnsReadyListener export internal dns ReadyListener for mobile
type ErrListener ¶ added in v0.14.6
type ErrListener interface { OnSuccess() OnError(error) }
ErrListener is async listener for mobile framework
type IFaceDiscover ¶ added in v0.14.6
type IFaceDiscover interface { stdnet.ExternalIFaceDiscover }
IFaceDiscover export internal IFaceDiscover for mobile
type PeerInfoArray ¶
type PeerInfoArray struct {
// contains filtered or unexported fields
}
PeerInfoArray is the implementation of the PeerInfoCollection
func (PeerInfoArray) Add ¶
func (array PeerInfoArray) Add(s PeerInfo) PeerInfoArray
Add new PeerInfo to the collection
func (PeerInfoArray) Get ¶
func (array PeerInfoArray) Get(i int) *PeerInfo
Get return an element of the collection
func (PeerInfoArray) Size ¶
func (array PeerInfoArray) Size() int
Size return with the size of the collection
type PeerInfoCollection ¶
type PeerInfoCollection interface { Add(s string) PeerInfoCollection Get(i int) string Size() int }
PeerInfoCollection made for Java layer to get non default types as collection
type Preferences ¶
type Preferences struct {
// contains filtered or unexported fields
}
Preferences export a subset of the internal config for gomobile
func NewPreferences ¶
func NewPreferences(configPath string) *Preferences
NewPreferences create new Preferences instance
func (*Preferences) Commit ¶
func (p *Preferences) Commit() error
Commit write out the changes into config file
func (*Preferences) GetAdminURL ¶
func (p *Preferences) GetAdminURL() (string, error)
GetAdminURL read url from config file
func (*Preferences) GetManagementURL ¶
func (p *Preferences) GetManagementURL() (string, error)
GetManagementURL read url from config file
func (*Preferences) GetPreSharedKey ¶
func (p *Preferences) GetPreSharedKey() (string, error)
GetPreSharedKey read preshared key from config file
func (*Preferences) SetAdminURL ¶
func (p *Preferences) SetAdminURL(url string)
SetAdminURL store the given url and wait for commit
func (*Preferences) SetManagementURL ¶
func (p *Preferences) SetManagementURL(url string)
SetManagementURL store the given url and wait for commit
func (*Preferences) SetPreSharedKey ¶
func (p *Preferences) SetPreSharedKey(key string)
SetPreSharedKey store the given key and wait for commit
type RouteListener ¶ added in v0.21.0
type RouteListener interface { routemanager.RouteListener }
RouteListener export internal RouteListener for mobile
type SSOListener ¶ added in v0.14.6
SSOListener is async listener for mobile framework
type TunAdapter ¶
type TunAdapter interface { iface.TunAdapter }
TunAdapter export internal TunAdapter for mobile