Documentation
¶
Overview ¶
Package types provides interfaces used in frontend packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBridgeWrap ¶
NewBridgeWrap wraps bridge struct into local bridgeWrap to implement local interface. The problem is that Bridge returns the bridge package's User type. Every method which returns User therefore has to be overridden to fulfill the interface.
func NewImportExportWrap ¶
func NewImportExportWrap(ie *importexport.ImportExport) *importExportWrap
NewImportExportWrap wraps import-export struct into local importExportWrap to implement local interface. The problem is that Import-Export returns the importexport package's User type. Every method which returns User therefore has to be overridden to fulfill the interface.
Types ¶
type Bridger ¶
type Bridger interface {
UserManager
ReportBug(osType, osVersion, description, accountName, address, emailClient string) error
AllowProxy()
DisallowProxy()
GetUpdateChannel() updater.UpdateChannel
SetUpdateChannel(updater.UpdateChannel) (needRestart bool, err error)
GetKeychainApp() string
SetKeychainApp(keychain string)
}
Bridger is an interface of bridge needed by frontend.
type ImportExporter ¶
type ImportExporter interface {
UserManager
GetLocalImporter(string, string, string) (*transfer.Transfer, error)
GetRemoteImporter(string, string, string, string, string, string) (*transfer.Transfer, error)
GetEMLExporter(string, string, string) (*transfer.Transfer, error)
GetMBOXExporter(string, string, string) (*transfer.Transfer, error)
ReportBug(osType, osVersion, description, accountName, address, emailClient string) error
ReportFile(osType, osVersion, accountName, address string, logdata []byte) error
}
ImportExporter is an interface of import-export needed by frontend.
type NoEncConfirmator ¶
type PanicHandler ¶
type PanicHandler interface {
HandlePanic()
}
PanicHandler is an interface of a type that can be used to gracefully handle panics which occur.
type Restarter ¶ added in v1.6.3
type Restarter interface {
SetToRestart()
}
Restarter allows the app to set itself to restart next time it is closed.
type Updater ¶
type Updater interface {
Check() (updater.VersionInfo, error)
InstallUpdate(updater.VersionInfo) error
IsUpdateApplicable(updater.VersionInfo) bool
CanInstall(updater.VersionInfo) bool
}
type User ¶
type User interface {
ID() string
Username() string
IsConnected() bool
IsCombinedAddressMode() bool
GetPrimaryAddress() string
GetAddresses() []string
GetBridgePassword() string
SwitchAddressMode() error
Logout() error
}
User is an interface of user needed by frontend.
type UserManager ¶
type UserManager interface {
Login(username string, password []byte) (pmapi.Client, *pmapi.Auth, error)
FinishLogin(client pmapi.Client, auth *pmapi.Auth, mailboxPassword []byte) (User, error)
GetUsers() []User
GetUser(query string) (User, error)
DeleteUser(userID string, clearCache bool) error
ClearData() error
}
UserManager is an interface of users needed by frontend.