Documentation ¶
Index ¶
- Constants
- Variables
- func TryBuildDebugMessage(path string) error
- type AccountMailboxMap
- type DebugMetadata
- type DiagMailboxMessage
- type DiagnosticMetadata
- type User
- func (user *User) AutoconfigUsed(client string)
- func (user *User) BadEventFeedbackResync(ctx context.Context) error
- func (user *User) BridgePass() []byte
- func (user *User) CheckAuth(email string, password []byte) (string, error)
- func (user *User) Close()
- func (user *User) DebugDownloadMessages(ctx context.Context, path string, msgs map[string]DiagMailboxMessage, ...) error
- func (user *User) DisplayNames() map[string]string
- func (user *User) Emails() []string
- func (user *User) ExternalLinkClicked(url string)
- func (user *User) GetAddressMode() vault.AddressMode
- func (user *User) GetDiagnosticMetadata(ctx context.Context) (DiagnosticMetadata, error)
- func (user *User) GetEventCh() <-chan events.Event
- func (user *User) GetGluonID(addrID string) (string, bool)
- func (user *User) GetGluonIDs() map[string]string
- func (user *User) GetSMTPService() *smtp.Service
- func (user *User) GluonKey() []byte
- func (user *User) ID() string
- func (user *User) IsTelemetryEnabled(ctx context.Context) bool
- func (user *User) Logout(ctx context.Context, withAPI bool) error
- func (user *User) Match(query string) bool
- func (user *User) MaxSpace() uint64
- func (user *User) Name() string
- func (user *User) OnBadEvent(ctx context.Context)
- func (user *User) PauseEventLoop()
- func (user *User) PauseEventLoopWithWaiter() *userevents.EventPollWaiter
- func (user *User) PublishEvent(_ context.Context, event events.Event)
- func (user *User) RemoveGluonID(addrID, gluonID string) error
- func (user *User) ReportBugClicked()
- func (user *User) ReportBugSent()
- func (user *User) ReportConfigStatusFailure(errDetails string)
- func (user *User) ReportSMTPAuthFailed(username string)
- func (user *User) ReportSMTPAuthSuccess(ctx context.Context)
- func (user *User) ResumeEventLoop()
- func (user *User) SendConfigStatusAbort(ctx context.Context, withTelemetry bool)
- func (user *User) SendConfigStatusProgress(ctx context.Context)
- func (user *User) SendConfigStatusRecovery(ctx context.Context)
- func (user *User) SendConfigStatusSuccess(ctx context.Context)
- func (user *User) SendTelemetry(ctx context.Context, data []byte) error
- func (user *User) SetAddressMode(ctx context.Context, mode vault.AddressMode) error
- func (user *User) SetGluonID(addrID, gluonID string) error
- func (user *User) SetShowAllMail(show bool)
- func (user *User) UsedSpace() uint64
Constants ¶
const (
SyncRetryCooldown = 20 * time.Second
)
Variables ¶
var ( ErrNoSuchAddress = errors.New("no such address") ErrMissingAddrKey = errors.New("missing address key") )
var ( EventPeriod = 20 * time.Second // nolint:gochecknoglobals,revive EventJitter = 20 * time.Second // nolint:gochecknoglobals,revive )
Functions ¶
func TryBuildDebugMessage ¶ added in v3.7.0
Types ¶
type AccountMailboxMap ¶ added in v3.4.0
type AccountMailboxMap map[string][]DiagMailboxMessage
type DebugMetadata ¶ added in v3.7.0
type DiagMailboxMessage ¶ added in v3.4.0
type DiagnosticMetadata ¶ added in v3.4.0
type DiagnosticMetadata struct { MessageIDs []string Metadata []proton.MessageMetadata FailedMessageIDs xmaps.Set[string] }
func (DiagnosticMetadata) BuildMailboxToMessageMap ¶ added in v3.4.0
func (apm DiagnosticMetadata) BuildMailboxToMessageMap(ctx context.Context, user *User) (map[string]AccountMailboxMap, error)
type User ¶
type User struct {
// contains filtered or unexported fields
}
func New ¶
func New( ctx context.Context, encVault *vault.User, client *proton.Client, reporter reporter.Reporter, apiUser proton.User, crashHandler async.PanicHandler, showAllMail bool, maxSyncMemory uint64, statsDir string, telemetryManager telemetry.Availability, imapServerManager imapservice.IMAPServerManager, smtpServerManager smtp.ServerManager, eventSubscription events.Subscription, syncService syncservice.Regulator, syncConfigDir string, isNew bool, ) (*User, error)
func (*User) AutoconfigUsed ¶ added in v3.3.1
func (*User) BadEventFeedbackResync ¶ added in v3.0.20
BadEventFeedbackResync sends user feedback whether should do message re-sync.
func (*User) BridgePass ¶
BridgePass returns the user's bridge password, used for authentication over SMTP and IMAP.
func (*User) CheckAuth ¶
CheckAuth returns whether the given email and password can be used to authenticate over IMAP or SMTP with this user. It returns the address ID of the authenticated address.
func (*User) Close ¶
func (user *User) Close()
Close closes ongoing connections and cleans up resources.
func (*User) DebugDownloadMessages ¶ added in v3.4.0
func (*User) DisplayNames ¶ added in v3.7.1
DisplayNames returns a map of the email addresses and their associated display names.
func (*User) Emails ¶
Emails returns all the user's active email addresses. It returns them in sorted order; the user's primary address is first.
func (*User) ExternalLinkClicked ¶ added in v3.8.0
func (*User) GetAddressMode ¶
func (user *User) GetAddressMode() vault.AddressMode
GetAddressMode returns the user's current address mode.
func (*User) GetDiagnosticMetadata ¶ added in v3.4.0
func (user *User) GetDiagnosticMetadata(ctx context.Context) (DiagnosticMetadata, error)
func (*User) GetEventCh ¶
GetEventCh returns a channel which notifies of events happening to the user (such as deauth, address change).
func (*User) GetGluonID ¶
GetGluonID returns the gluon ID for the given address, if present.
func (*User) GetGluonIDs ¶
GetGluonIDs returns the users gluon IDs.
func (*User) GetSMTPService ¶ added in v3.5.0
func (*User) IsTelemetryEnabled ¶ added in v3.2.0
IsTelemetryEnabled check if the telemetry is enabled or disabled for this user.
func (*User) OnBadEvent ¶ added in v3.5.0
func (*User) PauseEventLoop ¶ added in v3.5.0
func (user *User) PauseEventLoop()
func (*User) PauseEventLoopWithWaiter ¶ added in v3.5.0
func (user *User) PauseEventLoopWithWaiter() *userevents.EventPollWaiter
func (*User) PublishEvent ¶ added in v3.5.0
func (*User) RemoveGluonID ¶
RemoveGluonID removes the gluon ID for the given address.
func (*User) ReportBugClicked ¶ added in v3.3.1
func (user *User) ReportBugClicked()
func (*User) ReportBugSent ¶ added in v3.3.1
func (user *User) ReportBugSent()
func (*User) ReportConfigStatusFailure ¶ added in v3.3.1
func (*User) ReportSMTPAuthFailed ¶ added in v3.5.0
func (*User) ReportSMTPAuthSuccess ¶ added in v3.5.0
func (*User) ResumeEventLoop ¶ added in v3.5.0
func (user *User) ResumeEventLoop()
func (*User) SendConfigStatusAbort ¶ added in v3.3.1
func (*User) SendConfigStatusProgress ¶ added in v3.3.1
func (*User) SendConfigStatusRecovery ¶ added in v3.3.1
func (*User) SendConfigStatusSuccess ¶ added in v3.3.1
func (*User) SendTelemetry ¶ added in v3.2.0
SendTelemetry send telemetry request.
func (*User) SetAddressMode ¶
SetAddressMode sets the user's address mode.
func (*User) SetGluonID ¶
SetGluonID sets the gluon ID for the given address.
func (*User) SetShowAllMail ¶
SetShowAllMail sets whether to show the All Mail mailbox.