types

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package types provides interfaces used in frontend packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBridgeWrap

func NewBridgeWrap(bridge *bridge.Bridge) *bridgeWrap

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.

Types

type Bridger

type Bridger interface {
	UserManager

	ReportBug(osType, osVersion, description, accountName, address, emailClient string, attachLogs bool) error
	SetProxyAllowed(bool)
	GetProxyAllowed() bool
	EnableCache() error
	DisableCache() error
	MigrateCache(from, to string) error
	GetUpdateChannel() updater.UpdateChannel
	SetUpdateChannel(updater.UpdateChannel)
	GetKeychainApp() string
	SetKeychainApp(keychain string)
	HasError(err error) bool
	IsAutostartEnabled() bool
	EnableAutostart() error
	DisableAutostart() error
	GetLastVersion() string
	IsFirstStart() bool
	IsAllMailVisible() bool
	SetIsAllMailVisible(bool)
}

Bridger is an interface of bridge needed by frontend.

type NoEncConfirmator

type NoEncConfirmator interface {
	ConfirmNoEncryption(string, bool)
}

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

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
	UsedBytes() int64
	TotalBytes() int64
	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
	ClearUsers() error
	FactoryReset()
}

UserManager is an interface of users needed by frontend.

Jump to

Keyboard shortcuts

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