Documentation ¶
Index ¶
- Constants
- Variables
- type User
- func (user *User) BridgePass() []byte
- func (user *User) CheckAuth(email string, password []byte) (string, error)
- func (user *User) Close()
- func (user *User) Emails() []string
- func (user *User) GetAddressMode() vault.AddressMode
- 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) GluonKey() []byte
- func (user *User) ID() string
- func (user *User) Logout(ctx context.Context, withAPI bool) error
- func (user *User) Match(query string) bool
- func (user *User) MaxSpace() int
- func (user *User) Name() string
- func (user *User) NewIMAPConnector(addrID string) connector.Connector
- func (user *User) NewIMAPConnectors() (map[string]connector.Connector, error)
- func (user *User) OnStatusDown(context.Context)
- func (user *User) OnStatusUp(context.Context)
- func (user *User) RemoveGluonID(addrID, gluonID string) error
- func (user *User) SendMail(authID string, from string, to []string, r io.Reader) error
- func (user *User) SetAddressMode(_ context.Context, mode vault.AddressMode) error
- func (user *User) SetGluonID(addrID, gluonID string) error
- func (user *User) SetShowAllMail(show bool)
- func (user *User) UsedSpace() int
Constants ¶
const (
SyncRetryCooldown = 20 * time.Second
)
Variables ¶
var ( ErrNoSuchAddress = errors.New("no such address") ErrNotImplemented = errors.New("not implemented") ErrNotSupported = errors.New("not supported") ErrInvalidReturnPath = errors.New("invalid return path") ErrInvalidRecipient = errors.New("invalid recipient") ErrMissingAddrKey = errors.New("missing address key") )
var ( EventPeriod = 20 * time.Second // nolint:gochecknoglobals,revive EventJitter = 20 * time.Second // nolint:gochecknoglobals,revive )
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
func New ¶
func New( ctx context.Context, encVault *vault.User, client *proton.Client, apiUser proton.User, crashHandler async.PanicHandler, reporter gluonReporter.Reporter, syncWorkers int, showAllMail bool, ) (*User, error)
New returns a new user.
nolint:funlen
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) Emails ¶
Emails returns all the user's email addresses. It returns them in sorted order; the user's primary address is first.
func (*User) GetAddressMode ¶
func (user *User) GetAddressMode() vault.AddressMode
GetAddressMode returns the user's current address mode.
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) NewIMAPConnector ¶
NewIMAPConnector returns an IMAP connector for the given address. If not in split mode, this must be the primary address.
func (*User) NewIMAPConnectors ¶
NewIMAPConnectors returns IMAP connectors for each of the user's addresses. In combined mode, this is just the user's primary address. In split mode, this is all the user's addresses.
func (*User) OnStatusDown ¶
OnStatusDown is called when the connection goes down.
func (*User) OnStatusUp ¶
OnStatusUp is called when the connection goes up.
func (*User) RemoveGluonID ¶
RemoveGluonID removes the gluon ID for the given address.
func (*User) SendMail ¶
SendMail sends an email from the given address to the given recipients.
nolint:funlen
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.