android

package
v0.54.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

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 NewAuth

func NewAuth(cfgPath string, mgmURL string) (*Auth, error)

NewAuth instantiate Auth struct and validate the management URL

func NewAuthWithConfig

func NewAuthWithConfig(ctx context.Context, config *profilemanager.Config) *Auth

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 DNSList added in v0.21.9

type DNSList struct {
	// contains filtered or unexported fields
}

DNSList is a wrapper of []netip.AddrPort with default DNS port

func (*DNSList) Add added in v0.21.9

func (array *DNSList) Add(s string) error

Add new DNS address to the collection, returns error if invalid

func (*DNSList) Get added in v0.21.9

func (array *DNSList) Get(i int) (string, error)

Get return an element of the collection as string

func (*DNSList) Size added in v0.21.9

func (array *DNSList) Size() int

Size return with the size of the collection

type ErrListener added in v0.14.6

type ErrListener interface {
	OnSuccess()
	OnError(error)
}

ErrListener is async listener for mobile framework

type PeerInfo

type PeerInfo struct {
	IP         string
	FQDN       string
	ConnStatus string // Todo replace to enum
}

PeerInfo describe information about the peers. It designed for the UI usage

type PeerInfoArray

type PeerInfoArray struct {
	// contains filtered or unexported fields
}

PeerInfoArray is a wrapper of []PeerInfo

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 Preferences

type Preferences struct {
	// contains filtered or unexported fields
}

Preferences exports a subset of the internal config for gomobile

func NewPreferences

func NewPreferences(configPath string) *Preferences

NewPreferences creates a new Preferences instance

func (*Preferences) Commit

func (p *Preferences) Commit() error

Commit writes out the changes to the config file

func (*Preferences) GetAdminURL

func (p *Preferences) GetAdminURL() (string, error)

GetAdminURL reads URL from config file

func (*Preferences) GetBlockInbound added in v0.48.0

func (p *Preferences) GetBlockInbound() (bool, error)

GetBlockInbound reads block inbound setting from config file

func (*Preferences) GetDisableClientRoutes added in v0.48.0

func (p *Preferences) GetDisableClientRoutes() (bool, error)

GetDisableClientRoutes reads disable client routes setting from config file

func (*Preferences) GetDisableDNS added in v0.48.0

func (p *Preferences) GetDisableDNS() (bool, error)

GetDisableDNS reads disable DNS setting from config file

func (*Preferences) GetDisableFirewall added in v0.48.0

func (p *Preferences) GetDisableFirewall() (bool, error)

GetDisableFirewall reads disable firewall setting from config file

func (*Preferences) GetDisableServerRoutes added in v0.48.0

func (p *Preferences) GetDisableServerRoutes() (bool, error)

GetDisableServerRoutes reads disable server routes setting from config file

func (*Preferences) GetManagementURL

func (p *Preferences) GetManagementURL() (string, error)

GetManagementURL reads URL from config file

func (*Preferences) GetPreSharedKey

func (p *Preferences) GetPreSharedKey() (string, error)

GetPreSharedKey reads pre-shared key from config file

func (*Preferences) GetRosenpassEnabled added in v0.47.0

func (p *Preferences) GetRosenpassEnabled() (bool, error)

GetRosenpassEnabled reads Rosenpass enabled status from config file

func (*Preferences) GetRosenpassPermissive added in v0.47.0

func (p *Preferences) GetRosenpassPermissive() (bool, error)

GetRosenpassPermissive reads Rosenpass permissive setting from config file

func (*Preferences) GetServerSSHAllowed added in v0.48.0

func (p *Preferences) GetServerSSHAllowed() (bool, error)

GetServerSSHAllowed reads server SSH allowed setting from config file

func (*Preferences) SetAdminURL

func (p *Preferences) SetAdminURL(url string)

SetAdminURL stores the given URL and waits for commit

func (*Preferences) SetBlockInbound added in v0.48.0

func (p *Preferences) SetBlockInbound(block bool)

SetBlockInbound stores the given value and waits for commit

func (*Preferences) SetDisableClientRoutes added in v0.48.0

func (p *Preferences) SetDisableClientRoutes(disable bool)

SetDisableClientRoutes stores the given value and waits for commit

func (*Preferences) SetDisableDNS added in v0.48.0

func (p *Preferences) SetDisableDNS(disable bool)

SetDisableDNS stores the given value and waits for commit

func (*Preferences) SetDisableFirewall added in v0.48.0

func (p *Preferences) SetDisableFirewall(disable bool)

SetDisableFirewall stores the given value and waits for commit

func (*Preferences) SetDisableServerRoutes added in v0.48.0

func (p *Preferences) SetDisableServerRoutes(disable bool)

SetDisableServerRoutes stores the given value and waits for commit

func (*Preferences) SetManagementURL

func (p *Preferences) SetManagementURL(url string)

SetManagementURL stores the given URL and waits for commit

func (*Preferences) SetPreSharedKey

func (p *Preferences) SetPreSharedKey(key string)

SetPreSharedKey stores the given key and waits for commit

func (*Preferences) SetRosenpassEnabled added in v0.47.0

func (p *Preferences) SetRosenpassEnabled(enabled bool)

SetRosenpassEnabled stores whether Rosenpass is enabled

func (*Preferences) SetRosenpassPermissive added in v0.47.0

func (p *Preferences) SetRosenpassPermissive(permissive bool)

SetRosenpassPermissive stores the given permissive setting and waits for commit

func (*Preferences) SetServerSSHAllowed added in v0.48.0

func (p *Preferences) SetServerSSHAllowed(allowed bool)

SetServerSSHAllowed stores the given value and waits for commit

type SSOListener added in v0.14.6

type SSOListener interface {
	OnSuccess(bool)
	OnError(error)
}

SSOListener is async listener for mobile framework

type URLOpener

type URLOpener interface {
	Open(string)
}

URLOpener it is a callback interface. The Open function will be triggered if the backend want to show an url for the user

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL