Documentation ¶
Overview ¶
Package bridge provides core functionality of Bridge app.
Package bridge provides core functionality of Bridge app.
Index ¶
- Constants
- Variables
- type Bridge
- func (b *Bridge) AddError(err error)
- func (b *Bridge) ConfigureAppleMail(userID, address string) (bool, error)
- func (b *Bridge) DelError(err error)
- func (b *Bridge) DisableAutostart() error
- func (b *Bridge) DisableCache() error
- func (b *Bridge) EnableAutostart() error
- func (b *Bridge) EnableCache() error
- func (b *Bridge) FactoryReset()
- func (b *Bridge) Get(key settings.Key) string
- func (b *Bridge) GetBool(key settings.Key) bool
- func (b *Bridge) GetCurrentUserAgent() string
- func (b *Bridge) GetDependencyLicensesLink() string
- func (b *Bridge) GetInt(key settings.Key) int
- func (b *Bridge) GetKeychainApp() string
- func (b *Bridge) GetLastVersion() string
- func (b *Bridge) GetLicenseFilePath() string
- func (b *Bridge) GetProxyAllowed() bool
- func (b *Bridge) GetTLSConfig() (*tls.Config, error)
- func (b *Bridge) GetUpdateChannel() updater.UpdateChannel
- func (b *Bridge) HasError(err error) bool
- func (b *Bridge) IsAllMailVisible() bool
- func (b *Bridge) IsAutostartEnabled() bool
- func (b *Bridge) IsFirstStart() bool
- func (b *Bridge) MigrateCache(from, to string) error
- func (b *Bridge) ProvideLogsPath() (string, error)
- func (b *Bridge) ReportBug(osType, osVersion, description, accountName, address, emailClient string, ...) error
- func (b *Bridge) Set(key settings.Key, value string)
- func (b *Bridge) SetBool(key settings.Key, value bool)
- func (b *Bridge) SetCurrentPlatform(platform string)
- func (b *Bridge) SetInt(key settings.Key, value int)
- func (b *Bridge) SetIsAllMailVisible(isVisible bool)
- func (b *Bridge) SetKeychainApp(helper string)
- func (b *Bridge) SetProxyAllowed(proxyAllowed bool)
- func (b *Bridge) SetUpdateChannel(channel updater.UpdateChannel)
- type CacheProvider
- type LimitedBuffer
- type Locator
- type SettingsProvider
- type Updater
- type Versioner
Constants ¶
const ( MaxAttachmentSize = 7 * 1024 * 1024 // MaxAttachmentSize 7 MB total limit MaxCompressedFilesCount = 6 )
const (
Host = "127.0.0.1"
)
Host settings.
const ReleaseFixedBugs = `• Fixed sending error caused by inconsistent use of upper and lower case in sender’s email address
`
const ReleaseNotes = `
`
Variables ¶
var ErrSizeTooLarge = errors.New("file is too big")
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
func New ¶
func New( locations Locator, cacheProvider CacheProvider, setting SettingsProvider, sentryReporter *sentry.Reporter, panicHandler users.PanicHandler, eventListener listener.Listener, tls *tls.TLS, userAgent *useragent.UserAgent, cache cache.Cache, builder *message.Builder, clientManager pmapi.Manager, credStorer users.CredentialsStorer, updater Updater, versioner Versioner, autostart *autostart.App, ) *Bridge
func (*Bridge) AddError ¶
AddError add an error to a global error list if it does not contain it yet. Adding nil is noop.
func (*Bridge) ConfigureAppleMail ¶ added in v2.4.0
func (*Bridge) DisableAutostart ¶
DisableAutostart removes link and sets the preferences.
func (*Bridge) DisableCache ¶
func (*Bridge) EnableAutostart ¶
EnableAutostart creates link and sets the preferences.
func (*Bridge) EnableCache ¶
func (*Bridge) FactoryReset ¶
func (b *Bridge) FactoryReset()
FactoryReset will remove all local cache and settings. It will also downgrade to latest stable version if user is on early version.
func (*Bridge) GetCurrentUserAgent ¶ added in v2.4.0
func (*Bridge) GetDependencyLicensesLink ¶ added in v2.4.0
func (*Bridge) GetKeychainApp ¶
GetKeychainApp returns current keychain helper.
func (*Bridge) GetLastVersion ¶
GetLastVersion returns the version which was used in previous execution of Bridge.
func (*Bridge) GetLicenseFilePath ¶ added in v2.4.0
func (*Bridge) GetProxyAllowed ¶
GetProxyAllowed returns whether use of DoH is enabled to access an API proxy if necessary.
func (*Bridge) GetUpdateChannel ¶
func (b *Bridge) GetUpdateChannel() updater.UpdateChannel
GetUpdateChannel returns currently set update channel.
func (*Bridge) IsAllMailVisible ¶ added in v2.3.0
IsAllMailVisible can be called extensively by IMAP. Therefore, it is better to cache the value instead of reading from settings file.
func (*Bridge) IsAutostartEnabled ¶
IsAutostartEnabled checks if link file exits.
func (*Bridge) IsFirstStart ¶
IsFirstStart returns true when Bridge is running for first time or after factory reset.
func (*Bridge) MigrateCache ¶
func (*Bridge) ProvideLogsPath ¶ added in v2.4.0
func (*Bridge) ReportBug ¶
func (b *Bridge) ReportBug(osType, osVersion, description, accountName, address, emailClient string, attachLogs bool) error
ReportBug reports a new bug from the user.
func (*Bridge) SetCurrentPlatform ¶ added in v2.4.0
func (*Bridge) SetIsAllMailVisible ¶ added in v2.3.0
func (*Bridge) SetKeychainApp ¶
SetKeychainApp sets current keychain helper.
func (*Bridge) SetProxyAllowed ¶
SetProxyAllowed instructs the app whether to use DoH to access an API proxy if necessary. It also needs to work before the app is initialised (because we may need to use the proxy at startup).
func (*Bridge) SetUpdateChannel ¶
func (b *Bridge) SetUpdateChannel(channel updater.UpdateChannel)
SetUpdateChannel switches update channel.
type CacheProvider ¶
type LimitedBuffer ¶
type LimitedBuffer struct {
// contains filtered or unexported fields
}
func NewLimitedBuffer ¶
func NewLimitedBuffer(capacity int) *LimitedBuffer
type SettingsProvider ¶
type Updater ¶
type Updater interface { Check() (updater.VersionInfo, error) IsDowngrade(updater.VersionInfo) bool InstallUpdate(updater.VersionInfo) error }