Documentation
¶
Index ¶
- Constants
- func Envelope(header *rfc822.Header) (string, error)
- func IsCapabilityAvailableBeforeAuth(c Capability) bool
- func NewContextWithIMAPID(ctx context.Context, id IMAPID) context.Context
- func ShortID(id string) string
- func Structure(section *rfc822.Section) (string, string, error)
- type Capability
- type EpochUIDValidityGenerator
- type Field
- type FixedUIDValidityGenerator
- type FlagSet
- func (fs FlagSet) Add(flags ...string) FlagSet
- func (fs FlagSet) AddFlagSet(set FlagSet) FlagSet
- func (fs FlagSet) AddFlagSetToSelf(set FlagSet)
- func (fs FlagSet) AddToSelf(flags ...string)
- func (fs FlagSet) Clone() FlagSet
- func (fs FlagSet) Contains(flag string) bool
- func (fs FlagSet) ContainsAll(flags ...string) bool
- func (fs FlagSet) ContainsAny(flags ...string) bool
- func (fs FlagSet) ContainsUnchecked(flag string) bool
- func (fs FlagSet) Equals(otherFs FlagSet) bool
- func (fs FlagSet) Len() int
- func (fs FlagSet) Remove(flags ...string) FlagSet
- func (fs FlagSet) RemoveFlagSet(set FlagSet) FlagSet
- func (fs FlagSet) RemoveFlagSetFromSelf(set FlagSet)
- func (fs FlagSet) RemoveFromSelf(flags ...string)
- func (fs FlagSet) Set(flag string, on bool) FlagSet
- func (fs FlagSet) SetOnSelf(flag string, on bool)
- func (fs FlagSet) ToSlice() []string
- func (fs FlagSet) ToSliceUnsorted() []string
- type Header
- type IMAPID
- type IncrementalUIDValidityGenerator
- type InternalMailboxID
- type InternalMessageID
- type Mailbox
- type MailboxCreated
- type MailboxDeleted
- type MailboxID
- type MailboxIDChanged
- type MailboxUpdated
- type MailboxVisibility
- type Message
- type MessageCreated
- type MessageDeleted
- type MessageFlagsUpdated
- type MessageID
- type MessageIDChanged
- type MessageMailboxesUpdated
- type MessageUpdated
- type MessagesCreated
- type Noop
- type ParsedMessage
- type SeqID
- type SeqSet
- type SeqVal
- type UID
- type UIDValidityBumped
- type UIDValidityGenerator
- type Update
- type Waiter
Constants ¶
const ( AttrNoSelect = `\Noselect` AttrNoInferiors = `\Noinferiors` AttrMarked = `\Marked` AttrUnmarked = `\Unmarked` // Special Use attributes as defined in RFC-6154. AttrAll = `\All` AttrArchive = `\Archive` AttrDrafts = `\Drafts` AttrFlagged = `\Flagged` AttrJunk = `\Junk` AttrSent = `\Sent` AttrTrash = `\Trash` )
const ( FlagSeen = `\Seen` FlagAnswered = `\Answered` FlagFlagged = `\Flagged` FlagDeleted = `\Deleted` FlagDraft = `\Draft` FlagRecent = `\Recent` // Read-only!. )
const ( FlagSeenLowerCase = `\seen` FlagAnsweredLowerCase = `\answered` FlagFlaggedLowerCase = `\flagged` FlagDeletedLowerCase = `\deleted` FlagDraftLowerCase = `\draft` FlagRecentLowerCase = `\recent` // Read-only!. )
const ( IDKeyName = "name" IDKeyVersion = "version" IDKeyOS = "os" IdKeyOSVersion = "os-version" IDKeyVendor = "vendor" IDKeySupportURL = "support-url" IDKeyAddress = "address" IDKeyDate = "date" IDKeyCommand = "command" IDKeyArguments = "arguments" IDKeyEnvironment = "environment" IMAPIDConnMetadataKey = "rfc2971-id" )
const ( StatusMessages = `MESSAGES` StatusRecent = `RECENT` StatusUIDNext = `UIDNEXT` StatusUIDValidity = `UIDVALIDITY` StatusUnseen = `UNSEEN` )
const Inbox = "INBOX"
Variables ¶
This section is empty.
Functions ¶
func IsCapabilityAvailableBeforeAuth ¶ added in v0.12.0
func IsCapabilityAvailableBeforeAuth(c Capability) bool
func NewContextWithIMAPID ¶ added in v0.8.0
Types ¶
type Capability ¶
type Capability string
const ( IMAP4rev1 Capability = `IMAP4rev1` StartTLS Capability = `STARTTLS` IDLE Capability = `IDLE` UNSELECT Capability = `UNSELECT` UIDPLUS Capability = `UIDPLUS` MOVE Capability = `MOVE` ID Capability = `ID` )
type EpochUIDValidityGenerator ¶ added in v0.15.0
type EpochUIDValidityGenerator struct {
// contains filtered or unexported fields
}
func DefaultEpochUIDValidityGenerator ¶ added in v0.15.0
func DefaultEpochUIDValidityGenerator() *EpochUIDValidityGenerator
func NewEpochUIDValidityGenerator ¶ added in v0.15.0
func NewEpochUIDValidityGenerator(epochStart time.Time) *EpochUIDValidityGenerator
func (*EpochUIDValidityGenerator) Generate ¶ added in v0.15.0
func (e *EpochUIDValidityGenerator) Generate() (UID, error)
type FixedUIDValidityGenerator ¶ added in v0.15.0
type FixedUIDValidityGenerator struct {
Value UID
}
func NewFixedUIDValidityGenerator ¶ added in v0.15.0
func NewFixedUIDValidityGenerator(value UID) *FixedUIDValidityGenerator
func (FixedUIDValidityGenerator) Generate ¶ added in v0.15.0
func (f FixedUIDValidityGenerator) Generate() (UID, error)
type FlagSet ¶
FlagSet represents a set of IMAP flags. Flags are case-insensitive and no duplicates are allowed.
func NewFlagSet ¶
NewFlagSet creates a flag set containing the specified flags.
func NewFlagSetFromSlice ¶
NewFlagSetFromSlice creates a flag set containing the flags from a slice.
func NewFlagSetWithCapacity ¶ added in v0.12.0
func (FlagSet) Add ¶
Add adds new flags to the flag set. The function returns false iff no flags was actually added because they're already in the set. The case of existing elements is preserved.
func (FlagSet) AddFlagSet ¶
func (FlagSet) AddFlagSetToSelf ¶ added in v0.12.0
func (FlagSet) ContainsAll ¶
ContainsAll returns true if and only if all of the flags are in the set.
func (FlagSet) ContainsAny ¶
ContainsAny returns true if and only if any of the flags are in the set.
func (FlagSet) ContainsUnchecked ¶ added in v0.12.0
ContainsUnchecked returns true if and only if the flag is in the set. The flag is not converted to lower case. This is useful for cases where we need to check flags in bulk.
func (FlagSet) Equals ¶
Equals returns true if and only if the two sets are equal (same number of elements and each element of fs is also in otherFs).
func (FlagSet) RemoveFlagSet ¶
func (FlagSet) RemoveFlagSetFromSelf ¶ added in v0.12.0
func (FlagSet) RemoveFromSelf ¶ added in v0.12.0
func (FlagSet) SetOnSelf ¶ added in v0.12.0
SetOnSelf ensures the flagset either contains or does not contain the given flag.
func (FlagSet) ToSlice ¶
ToSlice Returns the list of flags in the set as a sorted string slice. The returned list is a hard copy of the internal slice to avoid direct modifications of the FlagSet value that would break the uniqueness and case insensitivity rules.
func (FlagSet) ToSliceUnsorted ¶ added in v0.17.0
ToSliceUnsorted is the same as ToSlice, but does not sort the returned value.
type IMAPID ¶ added in v0.12.0
type IMAPID struct { Name string Version string OS string OSVersion string Vendor string SupportURL string Address string Date string Command string Arguments string Environment string Other map[string]string }
IMAPID represents the RFC 2971 IMAP IMAPID Extension. This information can be retrieved by the connector at the context level. To do so please use the provided GetIMAPIDFromContext() function.
func GetIMAPIDFromContext ¶ added in v0.8.0
func NewIMAPIDFromKeyMap ¶ added in v0.8.0
func NewIMAPIDFromVersionInfo ¶ added in v0.8.0
type IncrementalUIDValidityGenerator ¶ added in v0.15.0
type IncrementalUIDValidityGenerator struct {
// contains filtered or unexported fields
}
func NewIncrementalUIDValidityGenerator ¶ added in v0.15.0
func NewIncrementalUIDValidityGenerator() *IncrementalUIDValidityGenerator
func (*IncrementalUIDValidityGenerator) Generate ¶ added in v0.15.0
func (i *IncrementalUIDValidityGenerator) Generate() (UID, error)
func (*IncrementalUIDValidityGenerator) GetValue ¶ added in v0.15.0
func (i *IncrementalUIDValidityGenerator) GetValue() UID
type InternalMailboxID ¶ added in v0.11.0
type InternalMailboxID uint64
func (InternalMailboxID) ShortID ¶ added in v0.11.0
func (i InternalMailboxID) ShortID() string
func (InternalMailboxID) String ¶ added in v0.12.0
func (i InternalMailboxID) String() string
type InternalMessageID ¶ added in v0.11.0
func InternalMessageIDFromString ¶ added in v0.12.0
func InternalMessageIDFromString(id string) (InternalMessageID, error)
func NewInternalMessageID ¶ added in v0.14.1
func NewInternalMessageID() InternalMessageID
func (InternalMessageID) ShortID ¶ added in v0.11.0
func (i InternalMessageID) ShortID() string
func (InternalMessageID) String ¶ added in v0.12.0
func (i InternalMessageID) String() string
type MailboxCreated ¶
type MailboxCreated struct { Mailbox Mailbox // contains filtered or unexported fields }
func NewMailboxCreated ¶
func NewMailboxCreated(mailbox Mailbox) *MailboxCreated
func (*MailboxCreated) String ¶
func (u *MailboxCreated) String() string
type MailboxDeleted ¶
type MailboxDeleted struct { MailboxID MailboxID // contains filtered or unexported fields }
func NewMailboxDeleted ¶
func NewMailboxDeleted(mailboxID MailboxID) *MailboxDeleted
func (*MailboxDeleted) String ¶
func (u *MailboxDeleted) String() string
type MailboxIDChanged ¶
type MailboxIDChanged struct { InternalID InternalMailboxID RemoteID MailboxID // contains filtered or unexported fields }
func NewMailboxIDChanged ¶
func NewMailboxIDChanged(internalID InternalMailboxID, remoteID MailboxID) *MailboxIDChanged
func (*MailboxIDChanged) String ¶
func (u *MailboxIDChanged) String() string
type MailboxUpdated ¶
type MailboxUpdated struct { MailboxID MailboxID MailboxName []string // contains filtered or unexported fields }
func NewMailboxUpdated ¶
func NewMailboxUpdated(mailboxID MailboxID, mailboxName []string) *MailboxUpdated
func (*MailboxUpdated) String ¶
func (u *MailboxUpdated) String() string
type MailboxVisibility ¶ added in v0.15.0
type MailboxVisibility int
const ( Hidden MailboxVisibility = iota Visible HiddenIfEmpty )
type MessageCreated ¶
type MessageCreated struct { Message Message Literal []byte MailboxIDs []MailboxID ParsedMessage *ParsedMessage }
type MessageDeleted ¶ added in v0.8.1
type MessageDeleted struct { MessageID MessageID // contains filtered or unexported fields }
func NewMessagesDeleted ¶ added in v0.8.1
func NewMessagesDeleted(messageID MessageID) *MessageDeleted
func (*MessageDeleted) String ¶ added in v0.8.1
func (u *MessageDeleted) String() string
type MessageFlagsUpdated ¶ added in v0.12.0
type MessageFlagsUpdated struct { MessageID MessageID Flags FlagSet // contains filtered or unexported fields }
func NewMessageFlagsUpdated ¶ added in v0.12.0
func NewMessageFlagsUpdated(messageID MessageID, flags FlagSet) *MessageFlagsUpdated
func (*MessageFlagsUpdated) String ¶ added in v0.12.0
func (u *MessageFlagsUpdated) String() string
type MessageIDChanged ¶
type MessageIDChanged struct { InternalID InternalMessageID RemoteID MessageID // contains filtered or unexported fields }
func NewMessageIDChanged ¶
func NewMessageIDChanged(internalID InternalMessageID, remoteID MessageID) *MessageIDChanged
func (*MessageIDChanged) String ¶
func (u *MessageIDChanged) String() string
type MessageMailboxesUpdated ¶ added in v0.13.0
type MessageMailboxesUpdated struct { MessageID MessageID MailboxIDs []MailboxID Flags FlagSet // contains filtered or unexported fields }
func NewMessageMailboxesUpdated ¶ added in v0.13.0
func NewMessageMailboxesUpdated(messageID MessageID, mailboxIDs []MailboxID, flags FlagSet) *MessageMailboxesUpdated
func (MessageMailboxesUpdated) Done ¶ added in v0.13.0
func (w MessageMailboxesUpdated) Done(err error)
func (*MessageMailboxesUpdated) String ¶ added in v0.13.0
func (u *MessageMailboxesUpdated) String() string
type MessageUpdated ¶
type MessageUpdated struct { Message Message Literal []byte MailboxIDs []MailboxID ParsedMessage *ParsedMessage AllowCreate bool // contains filtered or unexported fields }
MessageUpdated replaces the previous behavior of MessageDelete followed by MessageCreate. If the message does exist, it is updated. If the message does not exist, it can optionally be created. Furthermore, it guarantees that the operation is executed atomically.
func NewMessageUpdated ¶
func NewMessageUpdated( message Message, literal []byte, mailboxIDs []MailboxID, parsedMessage *ParsedMessage, allowCreate bool, ) *MessageUpdated
func (*MessageUpdated) String ¶
func (u *MessageUpdated) String() string
type MessagesCreated ¶ added in v0.7.0
type MessagesCreated struct { Messages []*MessageCreated // IgnoreUnknownMailboxIDs will allow message creation when one or more MailboxIDs are not yet known when set to true. IgnoreUnknownMailboxIDs bool // contains filtered or unexported fields }
func NewMessagesCreated ¶ added in v0.7.0
func NewMessagesCreated(ignoreUnknownMailboxIDs bool, updates ...*MessageCreated) *MessagesCreated
func (*MessagesCreated) String ¶ added in v0.7.0
func (u *MessagesCreated) String() string
type ParsedMessage ¶ added in v0.12.0
func NewParsedMessage ¶ added in v0.12.0
func NewParsedMessage(literal []byte) (*ParsedMessage, error)
type UIDValidityBumped ¶ added in v0.14.0
type UIDValidityBumped struct {
// contains filtered or unexported fields
}
func NewUIDValidityBumped ¶ added in v0.14.0
func NewUIDValidityBumped() *UIDValidityBumped
func (*UIDValidityBumped) String ¶ added in v0.14.0
func (u *UIDValidityBumped) String() string
type UIDValidityGenerator ¶ added in v0.15.0
type Waiter ¶
type Waiter interface { // Wait waits until the update has been marked as done. Wait() (error, bool) // WaitContext waits until the update has been marked as done or the context is cancelled. WaitContext(context.Context) (error, bool) // Done marks the update as done and report an error (if any). Done(error) }
Source Files
¶
- attributes.go
- capabilities.go
- envelope.go
- flags.go
- id.go
- mailbox.go
- message.go
- params.go
- seqset.go
- status.go
- strong_types.go
- structure.go
- uid_validity_generator.go
- update.go
- update_mailbox_created.go
- update_mailbox_deleted.go
- update_mailbox_id_changed.go
- update_mailbox_updated.go
- update_message_created.go
- update_message_deleted.go
- update_message_flags_updated.go
- update_message_id_changed.go
- update_message_labels_updated.go
- update_message_updated.go
- update_noop.go
- update_uid_validity_bumped.go
- update_waiter.go
- utils.go