Documentation ¶
Index ¶
- Constants
- Variables
- func GetDefaultSyncWorkerCount() int
- func GetHelper(vaultDir string) (string, error)
- func SetHelper(vaultDir, helper string) error
- type AddressMode
- type Cert
- type Certs
- type Data
- type Data_2_3_x
- type Data_2_4_x
- type File
- type Keychain
- type Settings
- type Settings_2_3_x
- type Settings_2_4_x
- type SyncStatus
- type User
- func (user *User) AddFailedMessageID(messageID string) error
- func (user *User) AddressMode() AddressMode
- func (user *User) AuthRef() string
- func (user *User) AuthUID() string
- func (user *User) BridgePass() []byte
- func (user *User) Clear() error
- func (user *User) ClearSyncStatus() error
- func (user *User) Close() error
- func (user *User) EventID() string
- func (user *User) GetGluonIDs() map[string]string
- func (user *User) GetUIDValidity(addrID string) imap.UID
- func (user *User) GluonKey() []byte
- func (user *User) KeyPass() []byte
- func (user *User) RemFailedMessageID(messageID string) error
- func (user *User) RemoveGluonID(addrID, gluonID string) error
- func (user *User) SetAddressMode(mode AddressMode) error
- func (user *User) SetAuth(authUID, authRef string) error
- func (user *User) SetBridgePass(newPass []byte) error
- func (user *User) SetEventID(eventID string) error
- func (user *User) SetGluonID(addrID, gluonID string) error
- func (user *User) SetHasLabels(hasLabels bool) error
- func (user *User) SetHasMessages(hasMessages bool) error
- func (user *User) SetKeyPass(keyPass []byte) error
- func (user *User) SetLastMessageID(messageID string) error
- func (user *User) SetUIDValidity(addrID string, validity imap.UID) error
- func (user *User) SyncStatus() SyncStatus
- func (user *User) UserID() string
- func (user *User) Username() string
- type UserData
- type UserData_2_3_x
- type UserData_2_4_x
- type Vault
- func (vault *Vault) AddUser(userID, username, authUID, authRef string, keyPass []byte) (*User, error)
- func (vault *Vault) Close() error
- func (vault *Vault) DeleteUser(userID string) error
- func (vault *Vault) ForUser(parallelism int, fn func(*User) error) error
- func (vault *Vault) GetAutoUpdate() bool
- func (vault *Vault) GetAutostart() bool
- func (vault *Vault) GetBridgeTLSCert() []byte
- func (vault *Vault) GetBridgeTLSKey() []byte
- func (vault *Vault) GetCertsInstalled() bool
- func (vault *Vault) GetColorScheme() string
- func (vault *Vault) GetCookies() ([]byte, error)
- func (vault *Vault) GetFirstStart() bool
- func (vault *Vault) GetFirstStartGUI() bool
- func (vault *Vault) GetGluonDir() string
- func (vault *Vault) GetIMAPPort() int
- func (vault *Vault) GetIMAPSSL() bool
- func (vault *Vault) GetLastVersion() *semver.Version
- func (vault *Vault) GetProxyAllowed() bool
- func (vault *Vault) GetSMTPPort() int
- func (vault *Vault) GetSMTPSSL() bool
- func (vault *Vault) GetShowAllMail() bool
- func (vault *Vault) GetUpdateChannel() updater.Channel
- func (vault *Vault) GetUpdateRollout() float64
- func (vault *Vault) GetUser(userID string, fn func(*User)) error
- func (vault *Vault) GetUserIDs() []string
- func (vault *Vault) HasUser(userID string) bool
- func (vault *Vault) Migrated() bool
- func (vault *Vault) NewUser(userID string) (*User, error)
- func (vault *Vault) Reset(gluonDir string) error
- func (vault *Vault) SetAutoUpdate(autoUpdate bool) error
- func (vault *Vault) SetAutostart(autostart bool) error
- func (vault *Vault) SetCertsInstalled(installed bool) error
- func (vault *Vault) SetColorScheme(colorScheme string) error
- func (vault *Vault) SetCookies(cookies []byte) error
- func (vault *Vault) SetFirstStart(firstStart bool) error
- func (vault *Vault) SetFirstStartGUI(firstStartGUI bool) error
- func (vault *Vault) SetGluonDir(dir string) error
- func (vault *Vault) SetIMAPPort(port int) error
- func (vault *Vault) SetIMAPSSL(ssl bool) error
- func (vault *Vault) SetLastVersion(version *semver.Version) error
- func (vault *Vault) SetMigrated() error
- func (vault *Vault) SetProxyAllowed(allowed bool) error
- func (vault *Vault) SetSMTPPort(port int) error
- func (vault *Vault) SetSMTPSSL(ssl bool) error
- func (vault *Vault) SetShowAllMail(showAllMail bool) error
- func (vault *Vault) SetSyncAttPool(pool int) error
- func (vault *Vault) SetSyncWorkers(workers int) error
- func (vault *Vault) SetUpdateChannel(channel updater.Channel) error
- func (vault *Vault) SetUpdateRollout(rollout float64) error
- func (vault *Vault) SyncAttPool() int
- func (vault *Vault) SyncWorkers() int
- type Version
Constants ¶
const (
Current = v2_5_x
)
Variables ¶
var RandomToken = crypto.RandomToken // nolint:gochecknoglobals
RandomToken is a function that returns a random token. By default, we use crypto.RandomToken to generate tokens.
Functions ¶
func GetDefaultSyncWorkerCount ¶
func GetDefaultSyncWorkerCount() int
Types ¶
type AddressMode ¶
type AddressMode int
const ( CombinedMode AddressMode = iota SplitMode )
func (AddressMode) String ¶
func (mode AddressMode) String() string
type Data_2_3_x ¶
type Data_2_3_x struct { Settings Settings_2_3_x Users []UserData_2_3_x }
type Data_2_4_x ¶
type Data_2_4_x struct { Settings Settings_2_4_x Users []UserData_2_4_x }
type Settings ¶
type Settings struct { GluonDir string IMAPPort int SMTPPort int IMAPSSL bool SMTPSSL bool UpdateChannel updater.Channel UpdateRollout float64 ColorScheme string ProxyAllowed bool ShowAllMail bool Autostart bool AutoUpdate bool LastVersion string FirstStart bool FirstStartGUI bool SyncWorkers int SyncAttPool int }
type Settings_2_3_x ¶
type Settings_2_4_x ¶
type SyncStatus ¶
type SyncStatus struct { HasLabels bool HasMessages bool LastMessageID string FailedMessageIDs []string }
func (SyncStatus) IsComplete ¶
func (status SyncStatus) IsComplete() bool
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) AddFailedMessageID ¶ added in v3.0.6
AddFailedMessageID adds a message ID to the list of failed message IDs.
func (*User) AddressMode ¶
func (user *User) AddressMode() AddressMode
AddressMode returns the user's address mode.
func (*User) BridgePass ¶
BridgePass returns the user's bridge password as raw token bytes (unencoded).
func (*User) ClearSyncStatus ¶
ClearSyncStatus clears the user's sync status.
func (*User) GetGluonIDs ¶
func (*User) RemFailedMessageID ¶ added in v3.0.6
RemFailedMessageID removes a message ID from the list of failed message IDs.
func (*User) RemoveGluonID ¶
func (*User) SetAddressMode ¶
func (user *User) SetAddressMode(mode AddressMode) error
SetAddressMode sets the address mode for the given user.
func (*User) SetBridgePass ¶ added in v3.0.7
SetBridgePass saves bridge password as raw token bytes (unecoded).
func (*User) SetEventID ¶
SetEventID sets the event ID for the given user.
func (*User) SetGluonID ¶
func (*User) SetHasLabels ¶
SetHasLabels sets whether the user's labels have been synced.
func (*User) SetHasMessages ¶
SetHasMessages sets whether the user's messages have been synced.
func (*User) SetKeyPass ¶
SetKeyPass sets the user's (salted) key password.
func (*User) SetLastMessageID ¶
SetLastMessageID sets the last synced message ID for the given user.
func (*User) SetUIDValidity ¶
func (*User) SyncStatus ¶
func (user *User) SyncStatus() SyncStatus
SyncStatus return's the user's sync status.
type UserData ¶
type UserData struct { UserID string Username string GluonKey []byte GluonIDs map[string]string UIDValidity map[string]imap.UID BridgePass []byte // raw token represented as byte slice (needs to be encoded) AddressMode AddressMode AuthUID string AuthRef string KeyPass []byte SyncStatus SyncStatus EventID string }
UserData holds information about a single bridge user. The user may or may not be logged in.
type UserData_2_3_x ¶
type UserData_2_4_x ¶
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault is an encrypted data vault that stores bridge and user data.
func New ¶
New constructs a new encrypted data vault at the given filepath using the given encryption key.
func (*Vault) AddUser ¶
func (vault *Vault) AddUser(userID, username, authUID, authRef string, keyPass []byte) (*User, error)
AddUser creates a new user in the vault with the given ID and username. A bridge password and gluon key are generated using the package's token generator.
func (*Vault) DeleteUser ¶
DeleteUser removes the given user from the vault.
func (*Vault) GetAutoUpdate ¶
GetAutoUpdate sets whether the bridge should automatically update.
func (*Vault) GetAutostart ¶
GetAutostart sets whether the bridge should autostart.
func (*Vault) GetBridgeTLSCert ¶
func (*Vault) GetBridgeTLSKey ¶
func (*Vault) GetCertsInstalled ¶
func (*Vault) GetColorScheme ¶
GetColorScheme sets the color scheme to be used by the bridge GUI.
func (*Vault) GetCookies ¶
func (*Vault) GetFirstStart ¶
GetFirstStart sets whether this is the first time the bridge has been started.
func (*Vault) GetFirstStartGUI ¶
GetFirstStartGUI sets whether this is the first time the bridge GUI has been started.
func (*Vault) GetGluonDir ¶
GetGluonDir sets the directory where the gluon should store its data.
func (*Vault) GetIMAPPort ¶
GetIMAPPort sets the port that the IMAP server should listen on.
func (*Vault) GetIMAPSSL ¶
GetIMAPSSL sets whether the IMAP server should use SSL.
func (*Vault) GetLastVersion ¶
func (vault *Vault) GetLastVersion() *semver.Version
GetLastVersion returns the last version of the bridge that was run.
func (*Vault) GetProxyAllowed ¶
GetProxyAllowed sets whether the bridge is allowed to use alternative routing.
func (*Vault) GetSMTPPort ¶
GetSMTPPort sets the port that the SMTP server should listen on.
func (*Vault) GetSMTPSSL ¶
GetSMTPSSL sets whether the SMTP server should use SSL.
func (*Vault) GetShowAllMail ¶
GetShowAllMail sets whether the bridge should show the All Mail folder.
func (*Vault) GetUpdateChannel ¶
GetUpdateChannel sets the update channel.
func (*Vault) GetUpdateRollout ¶
GetUpdateRollout sets the update rollout.
func (*Vault) GetUser ¶
GetUser provides access to a vault user. It returns an error if the user does not exist.
func (*Vault) GetUserIDs ¶
GetUserIDs returns the user IDs and usernames of all users in the vault.
func (*Vault) NewUser ¶
NewUser returns a new vault user. It must be closed before it can be deleted.
func (*Vault) SetAutoUpdate ¶
SetAutoUpdate sets whether the bridge should automatically update.
func (*Vault) SetAutostart ¶
SetAutostart sets whether the bridge should autostart.
func (*Vault) SetCertsInstalled ¶
func (*Vault) SetColorScheme ¶
SetColorScheme sets the color scheme to be used by the bridge GUI.
func (*Vault) SetCookies ¶
func (*Vault) SetFirstStart ¶
SetFirstStart sets whether this is the first time the bridge has been started.
func (*Vault) SetFirstStartGUI ¶
SetFirstStartGUI sets whether this is the first time the bridge GUI has been started.
func (*Vault) SetGluonDir ¶
SetGluonDir sets the directory where the gluon should store its data.
func (*Vault) SetIMAPPort ¶
SetIMAPPort sets the port that the IMAP server should listen on.
func (*Vault) SetIMAPSSL ¶
SetIMAPSSL sets whether the IMAP server should use SSL.
func (*Vault) SetLastVersion ¶
SetLastVersion sets the last version of the bridge that was run.
func (*Vault) SetMigrated ¶
func (*Vault) SetProxyAllowed ¶
SetProxyAllowed sets whether the bridge is allowed to use alternative routing.
func (*Vault) SetSMTPPort ¶
SetSMTPPort sets the port that the SMTP server should listen on.
func (*Vault) SetSMTPSSL ¶
SetSMTPSSL sets whether the SMTP server should use SSL.
func (*Vault) SetShowAllMail ¶
SetShowAllMail sets whether the bridge should show the All Mail folder.
func (*Vault) SetSyncAttPool ¶
SetSyncAttPool sets the size of the attachment pool.
func (*Vault) SetSyncWorkers ¶
SetSyncWorkers sets the number of workers to use for syncing.
func (*Vault) SetUpdateChannel ¶
SetUpdateChannel sets the update channel.
func (*Vault) SetUpdateRollout ¶
SetUpdateRollout sets the update rollout.
func (*Vault) SyncAttPool ¶
SyncAttPool returns the size of the attachment pool.
func (*Vault) SyncWorkers ¶
SyncWorkers returns the number of workers to use for syncing.