Documentation ¶
Overview ¶
Package connector defines the type that connects the server to a remote.
Index ¶
- Variables
- type Connector
- type Dummy
- func (conn *Dummy) Authorize(username, password string) bool
- func (conn *Dummy) ClearUpdates()
- func (conn *Dummy) Close(ctx context.Context) error
- func (conn *Dummy) CreateLabel(ctx context.Context, name []string) (imap.Mailbox, error)
- func (conn *Dummy) CreateMessage(ctx context.Context, mboxID imap.LabelID, literal []byte, flags imap.FlagSet, ...) (imap.Message, error)
- func (conn *Dummy) DeleteLabel(ctx context.Context, labelID imap.LabelID) error
- func (conn *Dummy) Flush()
- func (conn *Dummy) GetLabel(ctx context.Context, labelID imap.LabelID) (imap.Mailbox, error)
- func (conn *Dummy) GetLastRecordedIMAPID() imap.ID
- func (conn *Dummy) GetMessage(ctx context.Context, messageID imap.MessageID) (imap.Message, []imap.LabelID, error)
- func (conn *Dummy) GetUpdates() <-chan imap.Update
- func (conn *Dummy) LabelMessages(ctx context.Context, messageIDs []imap.MessageID, mboxID imap.LabelID) error
- func (conn *Dummy) MailboxCreated(mbox imap.Mailbox) error
- func (conn *Dummy) MailboxDeleted(labelID imap.LabelID) error
- func (conn *Dummy) MarkMessagesFlagged(ctx context.Context, messageIDs []imap.MessageID, flagged bool) error
- func (conn *Dummy) MarkMessagesSeen(ctx context.Context, messageIDs []imap.MessageID, seen bool) error
- func (conn *Dummy) MessageAdded(messageID imap.MessageID, labelID imap.LabelID) error
- func (conn *Dummy) MessageCreated(message imap.Message, literal []byte, mboxIDs []imap.LabelID) error
- func (conn *Dummy) MessageDeleted(messageID imap.MessageID) error
- func (conn *Dummy) MessageFlagged(messageID imap.MessageID, flagged bool) error
- func (conn *Dummy) MessageRemoved(messageID imap.MessageID, labelID imap.LabelID) error
- func (conn *Dummy) MessageSeen(messageID imap.MessageID, seen bool) error
- func (conn *Dummy) Pause()
- func (conn *Dummy) Resume()
- func (conn *Dummy) SetFolderPrefix(pfx string)
- func (conn *Dummy) SetLabelPrefix(pfx string)
- func (conn *Dummy) Sync(ctx context.Context) error
- func (conn *Dummy) UnlabelMessages(ctx context.Context, messageIDs []imap.MessageID, mboxID imap.LabelID) error
- func (conn *Dummy) UpdateLabel(ctx context.Context, labelID imap.LabelID, name []string) error
- func (conn *Dummy) ValidateCreate(name []string) (imap.FlagSet, imap.FlagSet, imap.FlagSet, error)
- func (conn *Dummy) ValidateDelete(name []string) error
- func (conn *Dummy) ValidateUpdate(oldName, newName []string) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface { // Authorize returns whether the given username/password combination are valid for this connector. Authorize(username, password string) bool // ValidateCreate checks whether a mailbox with the given name can be created. // If so, the flags, permanent flags and attributes which the mailbox would have are returned. ValidateCreate(name []string) (flags, permFlags, attrs imap.FlagSet, err error) // ValidateUpdate checks whether a mailbox's name can be changed from oldName to newName. ValidateUpdate(oldName, newName []string) error // ValidateDelete checks whether the mailbox with the given name can be deleted. ValidateDelete(name []string) error // GetLabel returns information about the label with the given ID. GetLabel(ctx context.Context, labelID imap.LabelID) (imap.Mailbox, error) // CreateLabel creates a label with the given name. CreateLabel(ctx context.Context, name []string) (imap.Mailbox, error) // UpdateLabel sets the name of the label with the given ID. UpdateLabel(ctx context.Context, labelID imap.LabelID, newName []string) error // DeleteLabel deletes the label with the given ID. DeleteLabel(ctx context.Context, labelID imap.LabelID) error // GetMessage returns the message with the given ID. GetMessage(ctx context.Context, messageID imap.MessageID) (imap.Message, []imap.LabelID, error) // CreateMessage creates a new message on the remote. CreateMessage(ctx context.Context, labelID imap.LabelID, literal []byte, flags imap.FlagSet, date time.Time) (imap.Message, error) // LabelMessages labels the given messages with the given label ID. LabelMessages(ctx context.Context, messageIDs []imap.MessageID, labelID imap.LabelID) error // UnlabelMessages unlabels the given messages with the given label ID. UnlabelMessages(ctx context.Context, messageIDs []imap.MessageID, labelID imap.LabelID) error // MarkMessagesSeen sets the seen value of the given messages. MarkMessagesSeen(ctx context.Context, messageIDs []imap.MessageID, seen bool) error // MarkMessagesFlagged sets the flagged value of the given messages. MarkMessagesFlagged(ctx context.Context, messageIDs []imap.MessageID, flagged bool) error // GetUpdates returns a stream of updates that the gluon server should apply. GetUpdates() <-chan imap.Update // Pause pauses the stream of updates. Pause() // Resume resumes the stream of updates. Resume() // Close the connector will no longer be used and all resources should be closed/released. Close(ctx context.Context) error }
Connector connects the gluon server to a remote mail store.
type Dummy ¶
type Dummy struct {
// contains filtered or unexported fields
}
func (*Dummy) ClearUpdates ¶ added in v0.9.0
func (conn *Dummy) ClearUpdates()
func (*Dummy) CreateLabel ¶
func (*Dummy) CreateMessage ¶
func (*Dummy) DeleteLabel ¶
func (*Dummy) GetLastRecordedIMAPID ¶ added in v0.8.0
func (*Dummy) GetMessage ¶
func (*Dummy) GetUpdates ¶
func (*Dummy) LabelMessages ¶
func (*Dummy) MarkMessagesFlagged ¶
func (*Dummy) MarkMessagesSeen ¶
func (*Dummy) MessageAdded ¶
func (*Dummy) MessageCreated ¶
func (*Dummy) MessageDeleted ¶ added in v0.8.1
func (*Dummy) MessageFlagged ¶
func (*Dummy) MessageRemoved ¶
func (*Dummy) MessageSeen ¶
func (*Dummy) SetFolderPrefix ¶
func (*Dummy) SetLabelPrefix ¶
func (*Dummy) UnlabelMessages ¶
func (*Dummy) UpdateLabel ¶
func (*Dummy) ValidateCreate ¶
func (*Dummy) ValidateDelete ¶
func (*Dummy) ValidateUpdate ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_connector is a generated GoMock package.
|
Package mock_connector is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.