bridge

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package bridge provides core functionality of Bridge app.

Index

Constants

View Source
const Credits = "" /* 1801-byte string literal not displayed */
View Source
const (
	Host = "127.0.0.1"
)

Host settings.

View Source
const ReleaseFixedBugs = `• Fixed sending error caused by inconsistent use of upper and lower case in sender’s email address
`
View Source
const ReleaseNotes = `
`

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	*users.Users
	// contains filtered or unexported fields
}

func New

func New(
	locations Locator,
	cache Cacher,
	s SettingsProvider,
	panicHandler users.PanicHandler,
	eventListener listener.Listener,
	clientManager users.ClientManager,
	credStorer users.CredentialsStorer,
	updater Updater,
	versioner Versioner,
) *Bridge

func (*Bridge) GetCurrentClient

func (b *Bridge) GetCurrentClient() string

GetCurrentClient returns currently connected client (e.g. Thunderbird).

func (*Bridge) GetUpdateChannel added in v1.6.3

func (b *Bridge) GetUpdateChannel() updater.UpdateChannel

GetUpdateChannel returns currently set update channel.

func (*Bridge) ReportBug

func (b *Bridge) ReportBug(osType, osVersion, description, accountName, address, emailClient string) error

ReportBug reports a new bug from the user.

func (*Bridge) SetCurrentClient

func (b *Bridge) SetCurrentClient(clientName, clientVersion string)

SetCurrentClient updates client info (e.g. Thunderbird) and sets the user agent on pmapi. By default no client is used, IMAP has to detect it on first login.

func (*Bridge) SetCurrentOS

func (b *Bridge) SetCurrentOS(os string)

SetCurrentOS updates OS and sets the user agent on pmapi. By default we use `runtime.GOOS`, but this can be overridden in case of better detection.

func (*Bridge) SetUpdateChannel added in v1.6.3

func (b *Bridge) SetUpdateChannel(channel updater.UpdateChannel) error

SetUpdateChannel switches update channel. Downgrading to previous version (by switching from early to stable, for example) requires clearing all data including update files due to possibility of inconsistency between versions and absence of backwards migration scripts.

type Cacher added in v1.6.3

type Cacher interface {
	GetIMAPCachePath() string
	GetDBDir() string
}

type Locator added in v1.6.3

type Locator interface {
	Clear() error
	ClearUpdates() error
}

type SettingsProvider added in v1.6.3

type SettingsProvider interface {
	Get(key string) string
	Set(key string, value string)
	GetBool(key string) bool
	SetBool(key string, val bool)
}

type Updater added in v1.6.3

type Updater interface {
	Check() (updater.VersionInfo, error)
	IsDowngrade(updater.VersionInfo) bool
	InstallUpdate(updater.VersionInfo) error
}

type Versioner added in v1.6.3

type Versioner interface {
	RemoveOtherVersions(*semver.Version) error
}

Jump to

Keyboard shortcuts

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