Documentation ¶
Overview ¶
Package account implements the provider account backend.
Index ¶
- type Account
- func (a *Account) Deref()
- func (a *Account) EnqueueKaetzchenRequest(recipient *Recipient, msg []byte, isUnreliable bool) ([]byte, error)
- func (a *Account) EnqueueMessage(recipient *Recipient, msg []byte, isUnreliable bool) ([]byte, error)
- func (a *Account) GetID() string
- func (a *Account) IsConnected() bool
- func (a *Account) ReceivePeekPop(isPop bool) ([]byte, *ecdh.PublicKey, []byte, error)
- func (a *Account) StoreReport(payload []byte) error
- type Recipient
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { worker.Worker sync.Mutex InsecureKeyDiscovery bool // contains filtered or unexported fields }
Account is a Provider account and it's associated client instance.
func (*Account) Deref ¶
func (a *Account) Deref()
Deref decrements the reference count of the Account. If the reference count reaches 0, the Account will be torn down and removed from it's associated Store.
func (*Account) EnqueueKaetzchenRequest ¶
func (a *Account) EnqueueKaetzchenRequest(recipient *Recipient, msg []byte, isUnreliable bool) ([]byte, error)
EnqueueKaetzchenRequest enqueues a Katzchen request for transmission.
Note: Kaetzchen requests are treated as "urgent" and will skip to the head of the transmit queue. Additonally, the requests are considered one-shot and not retransmitted.
func (*Account) EnqueueMessage ¶
func (a *Account) EnqueueMessage(recipient *Recipient, msg []byte, isUnreliable bool) ([]byte, error)
EnqueueMessage enqueues a message for transmission.
func (*Account) IsConnected ¶
IsConnected returns true iff the account is connected.
func (*Account) ReceivePeekPop ¶
ReceivePeekPop returns the eldest message in the receive queue, the sender's public key, and a unique identifier, optionally after removing the message from the queue.
func (*Account) StoreReport ¶
StoreReport stores a locally generated report directly in the account's receive spool.
type Store ¶
Store is a group of Account instances.
func NewStore ¶
func NewStore(g glue.ProxyInternals) *Store
NewStore constructs a new Store instance.
func (*Store) Get ¶
Get returns the Account identified by id, after incrementing the reference count.
func (*Store) NewSession ¶
func (s *Store) NewSession(user, pass []byte) (pop3.BackendSession, error)
NewSession creates a new pop3.BackendSession backed by the specified user, where the user is of the form `user@provider`.