Documentation ¶
Index ¶
- Variables
- type ConnMetadataID
- type Manager
- type OpConnMetadataStoreCreate
- type OpConnMetadataStoreDelete
- type OpConnMetadataStoreSetValue
- type OpMailboxCreate
- type OpMailboxDelete
- type OpMailboxUpdate
- type OpMessageAdd
- type OpMessageCreate
- type OpMessageFlagged
- type OpMessageRemove
- type OpMessageSeen
- type OperationBase
- type User
- func (user *User) AddMessagesToMailbox(metadataID ConnMetadataID, messageIDs []string, mboxID string) error
- func (user *User) Close() error
- func (user *User) CreateConnMetadataStore(metadataID ConnMetadataID) error
- func (user *User) CreateMailbox(metadataID ConnMetadataID, name []string) (imap.Mailbox, error)
- func (user *User) CreateMessage(metadataID ConnMetadataID, mboxID string, literal []byte, flags imap.FlagSet, ...) (imap.Message, error)
- func (user *User) DeleteConnMetadataStore(metadataID ConnMetadataID) error
- func (user *User) DeleteMailbox(metadataID ConnMetadataID, mboxID string, name []string) error
- func (user *User) GetUpdates() <-chan imap.Update
- func (user *User) RemoveMessagesFromMailbox(metadataID ConnMetadataID, messageIDs []string, mboxID string) error
- func (user *User) SetConnMetadataValue(metadataID ConnMetadataID, key string, value any) error
- func (user *User) SetMessagesFlagged(metadataID ConnMetadataID, messageIDs []string, flagged bool) error
- func (user *User) SetMessagesSeen(metadataID ConnMetadataID, messageIDs []string, seen bool) error
- func (user *User) UpdateMailbox(metadataID ConnMetadataID, mboxID string, oldName, newName []string) error
Constants ¶
This section is empty.
Variables ¶
var ErrNoSuchUser = errors.New("no such user")
var ErrQueueClosed = errors.New("the queue is closed")
Functions ¶
This section is empty.
Types ¶
type ConnMetadataID ¶ added in v0.6.0
type ConnMetadataID uint32
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides access to remote users.
func New ¶
New returns a new manager which stores serialized operation queues for users in the given base directory.
func (*Manager) AddUser ¶
AddUser adds the remote user with the given (IMAP) credentials to the remote manager. The user interacts with the remote via the given connector.
func (*Manager) RemoveUser ¶ added in v0.5.0
RemoveUser removes the user with the given ID from the remote manager. It waits until all the user's queued operations have been performed. TODO: Find a better way to flush the operation queue?
type OpConnMetadataStoreCreate ¶ added in v0.6.0
type OpConnMetadataStoreCreate struct {
OperationBase
}
type OpConnMetadataStoreDelete ¶ added in v0.6.0
type OpConnMetadataStoreDelete struct {
OperationBase
}
type OpConnMetadataStoreSetValue ¶ added in v0.6.0
type OpConnMetadataStoreSetValue struct { OperationBase Key string Value any }
type OpMailboxCreate ¶
type OpMailboxCreate struct { OperationBase TempID string Name []string }
type OpMailboxDelete ¶
type OpMailboxDelete struct { OperationBase MBoxID string }
type OpMailboxUpdate ¶
type OpMailboxUpdate struct { OperationBase MBoxID string Name []string }
type OpMessageAdd ¶
type OpMessageAdd struct { OperationBase MessageIDs []string MBoxID string }
type OpMessageCreate ¶
type OpMessageFlagged ¶
type OpMessageFlagged struct { OperationBase MessageIDs []string Flagged bool }
type OpMessageRemove ¶
type OpMessageRemove struct { OperationBase MessageIDs []string MBoxID string }
type OpMessageSeen ¶
type OpMessageSeen struct { OperationBase MessageIDs []string Seen bool }
type OperationBase ¶ added in v0.6.0
type OperationBase struct {
MetadataID ConnMetadataID
}
type User ¶
type User struct {
// contains filtered or unexported fields
}
User performs operations against a remote server using a connector.
func (*User) AddMessagesToMailbox ¶
func (user *User) AddMessagesToMailbox(metadataID ConnMetadataID, messageIDs []string, mboxID string) error
AddMessageToMailbox adds the message with the given ID to the mailbox with the given ID.
func (*User) CreateConnMetadataStore ¶ added in v0.6.0
func (user *User) CreateConnMetadataStore(metadataID ConnMetadataID) error
func (*User) CreateMailbox ¶
CreateMailbox creates a new mailbox with the given name.
func (*User) CreateMessage ¶
func (user *User) CreateMessage(metadataID ConnMetadataID, mboxID string, literal []byte, flags imap.FlagSet, date time.Time) (imap.Message, error)
CreateMessage appends a message literal to the mailbox with the given ID.
func (*User) DeleteConnMetadataStore ¶ added in v0.6.0
func (user *User) DeleteConnMetadataStore(metadataID ConnMetadataID) error
func (*User) DeleteMailbox ¶
func (user *User) DeleteMailbox(metadataID ConnMetadataID, mboxID string, name []string) error
DeleteMailbox deletes the mailbox with the given ID and name.
func (*User) GetUpdates ¶
GetUpdates returns a channel on which updates from the server are sent.
func (*User) RemoveMessagesFromMailbox ¶
func (user *User) RemoveMessagesFromMailbox(metadataID ConnMetadataID, messageIDs []string, mboxID string) error
RemoveMessageFromMailbox removes the message with the given ID from the mailbox with the given ID.
func (*User) SetConnMetadataValue ¶ added in v0.6.0
func (user *User) SetConnMetadataValue(metadataID ConnMetadataID, key string, value any) error
func (*User) SetMessagesFlagged ¶
func (user *User) SetMessagesFlagged(metadataID ConnMetadataID, messageIDs []string, flagged bool) error
SetMessageFlagged marks the message with the given ID as seen or unseen.
func (*User) SetMessagesSeen ¶
func (user *User) SetMessagesSeen(metadataID ConnMetadataID, messageIDs []string, seen bool) error
SetMessageSeen marks the message with the given ID as seen or unseen.
func (*User) UpdateMailbox ¶
func (user *User) UpdateMailbox(metadataID ConnMetadataID, mboxID string, oldName, newName []string) error
UpdateMailbox sets the name of the mailbox with the given ID to the given new name.
Source Files ¶
- conn_metadata.go
- manager.go
- operation.go
- operation_conn_metadata_store.go
- operation_mailbox_create.go
- operation_mailbox_delete.go
- operation_mailbox_update.go
- operation_message_add.go
- operation_message_create.go
- operation_message_flagged.go
- operation_message_remove.go
- operation_message_seen.go
- user.go
- user_conn_metadata.go
- user_execute.go
- user_mailbox.go
- user_message.go
- user_queue.go
Directories ¶
Path | Synopsis |
---|---|
Package mock_remote is a generated GoMock package.
|
Package mock_remote is a generated GoMock package. |