imap

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttrNoSelect    = `\NoSelect`
	AttrNoInferiors = `\NoInferiors`
	AttrMarked      = `\Marked`
	AttrUnmarked    = `\Unmarked`
)
View Source
const (
	FlagSeen     = `\Seen`
	FlagAnswered = `\Answered`
	FlagFlagged  = `\Flagged`
	FlagDeleted  = `\Deleted`
	FlagDraft    = `\Draft`
	FlagRecent   = `\Recent` // Read-only!.
)
View Source
const (
	StatusMessages    = `MESSAGES`
	StatusRecent      = `RECENT`
	StatusUIDNext     = `UIDNEXT`
	StatusUIDValidity = `UIDVALIDITY`
	StatusUnseen      = `UNSEEN`
)
View Source
const Inbox = "INBOX"

Variables

This section is empty.

Functions

func Envelope

func Envelope(header *rfc822.Header) (string, error)

func Structure

func Structure(section *rfc822.Section, ext bool) (string, error)

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`
)

type Field

type Field struct {
	Key, Value string
}

type FlagSet

type FlagSet map[string]string

FlagSet represents a set of IMAP flags. Flags are case-insensitive and no duplicates are allowed.

func NewFlagSet

func NewFlagSet(flags ...string) FlagSet

NewFlagSet creates a flag set containing the specified flags.

func NewFlagSetFromSlice

func NewFlagSetFromSlice(flags []string) FlagSet

NewFlagSetFromSlice creates a flag set containing the flags from a slice.

func (FlagSet) Add

func (fs FlagSet) Add(flags ...string) FlagSet

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 (fs FlagSet) AddFlagSet(set FlagSet) FlagSet

func (FlagSet) Contains

func (fs FlagSet) Contains(flag string) bool

Contains returns true if and only if the flag is in the set.

func (FlagSet) ContainsAll

func (fs FlagSet) ContainsAll(flags ...string) bool

ContainsAll returns true if and only if all of the flags are in the set.

func (FlagSet) ContainsAny

func (fs FlagSet) ContainsAny(flags ...string) bool

ContainsAny returns true if and only if any of the flags are in the set.

func (FlagSet) Equals

func (fs FlagSet) Equals(otherFs FlagSet) bool

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) Len

func (fs FlagSet) Len() int

Len returns the number of flags in the flag set.

func (FlagSet) Remove

func (fs FlagSet) Remove(flags ...string) FlagSet

Remove removes a list of flags from the set. The function returns false iif no flag was actually removed.

func (FlagSet) RemoveFlagSet

func (fs FlagSet) RemoveFlagSet(set FlagSet) FlagSet

func (FlagSet) Set

func (fs FlagSet) Set(flag string, on bool) FlagSet

Set ensures the flagset either contains or does not contain the given flag.

func (FlagSet) ToSlice

func (fs FlagSet) ToSlice() []string

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.

type Header []Field

type Mailbox

type Mailbox struct {
	ID string

	Name []string

	Flags, PermanentFlags, Attributes FlagSet
}

type MailboxCreated

type MailboxCreated struct {
	Mailbox Mailbox
	// contains filtered or unexported fields
}

func NewMailboxCreated

func NewMailboxCreated(mailbox Mailbox) MailboxCreated

func (MailboxCreated) Done

func (w MailboxCreated) Done()

func (MailboxCreated) String

func (u MailboxCreated) String() string

func (MailboxCreated) Wait

func (w MailboxCreated) Wait()

type MailboxDeleted

type MailboxDeleted struct {
	MailboxID string
	// contains filtered or unexported fields
}

func NewMailboxDeleted

func NewMailboxDeleted(mailboxID string) MailboxDeleted

func (MailboxDeleted) Done

func (w MailboxDeleted) Done()

func (MailboxDeleted) String

func (u MailboxDeleted) String() string

func (MailboxDeleted) Wait

func (w MailboxDeleted) Wait()

type MailboxIDChanged

type MailboxIDChanged struct {
	OldID string
	NewID string
	// contains filtered or unexported fields
}

func NewMailboxIDChanged

func NewMailboxIDChanged(oldID, newID string) MailboxIDChanged

func (MailboxIDChanged) Done

func (w MailboxIDChanged) Done()

func (MailboxIDChanged) String

func (u MailboxIDChanged) String() string

func (MailboxIDChanged) Wait

func (w MailboxIDChanged) Wait()

type MailboxUpdated

type MailboxUpdated struct {
	MailboxID   string
	MailboxName []string
	// contains filtered or unexported fields
}

func NewMailboxUpdated

func NewMailboxUpdated(mailboxID string, mailboxName []string) MailboxUpdated

func (MailboxUpdated) Done

func (w MailboxUpdated) Done()

func (MailboxUpdated) String

func (u MailboxUpdated) String() string

func (MailboxUpdated) Wait

func (w MailboxUpdated) Wait()

type Message

type Message struct {
	ID    string
	Flags FlagSet
	Date  time.Time
}

func (*Message) HasFlag

func (m *Message) HasFlag(wantFlag string) bool

type MessageCreated

type MessageCreated struct {
	Message    Message
	Literal    []byte
	MailboxIDs []string

	Body      string
	Structure string
	Envelope  string
	// contains filtered or unexported fields
}

func NewMessageCreated

func NewMessageCreated(message Message, literal []byte, mailboxIDs []string) (MessageCreated, error)

func (MessageCreated) Done

func (w MessageCreated) Done()

func (MessageCreated) String

func (u MessageCreated) String() string

func (MessageCreated) Wait

func (w MessageCreated) Wait()

type MessageIDChanged

type MessageIDChanged struct {
	OldID string
	NewID string
	// contains filtered or unexported fields
}

func NewMessageIDChanged

func NewMessageIDChanged(oldID, newID string) MessageIDChanged

func (MessageIDChanged) Done

func (w MessageIDChanged) Done()

func (MessageIDChanged) String

func (u MessageIDChanged) String() string

func (MessageIDChanged) Wait

func (w MessageIDChanged) Wait()

type MessageUpdated

type MessageUpdated struct {
	MessageID     string
	MailboxIDs    []string
	Seen, Flagged bool
	// contains filtered or unexported fields
}

func NewMessageUpdated

func NewMessageUpdated(messageID string, mailboxIDs []string, seen, flagged bool) MessageUpdated

func (MessageUpdated) Done

func (w MessageUpdated) Done()

func (MessageUpdated) String

func (u MessageUpdated) String() string

func (MessageUpdated) Wait

func (w MessageUpdated) Wait()

type SeqSet

type SeqSet []SeqVal

func NewSeqSet

func NewSeqSet(set []int) SeqSet

func (SeqSet) String

func (set SeqSet) String() string

type SeqVal

type SeqVal struct {
	Begin, End int
}

func (SeqVal) String

func (seqval SeqVal) String() string

type Update

type Update interface {
	Waiter

	String() string
	// contains filtered or unexported methods
}

type Waiter

type Waiter interface {
	Wait()
	Done()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL