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) 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) GetKeychainApp() string
- func (b *Bridge) GetLastVersion() string
- func (b *Bridge) GetProxyAllowed() bool
- func (b *Bridge) GetUpdateChannel() updater.UpdateChannel
- func (b *Bridge) HasError(err error) bool
- func (b *Bridge) IsAutostartEnabled() bool
- func (b *Bridge) IsFirstStart() bool
- func (b *Bridge) MigrateCache(from, to string) error
- func (b *Bridge) ReportBug(osType, osVersion, description, accountName, address, emailClient string, ...) error
- 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 // 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, 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) 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) GetKeychainApp ¶
GetKeychainApp returns current keychain helper.
func (*Bridge) GetLastVersion ¶
GetLastVersion returns the version which was used in previous execution of Bridge.
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) 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) 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) 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 }