types

package
v0.0.0-...-1cf758b Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: MIT Imports: 8 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags int32

Flags provide information on flags that are attached to a message

const (
	FlagSeen Flags = 1 << iota
	FlagAnswered
	FlagFlagged
	FlagDeleted
	FlagDraft
	FlagRecent // Can not be set by client!
)

Various flags that are permitted to be set/unset.

func CombineFlags

func CombineFlags(flags ...Flags) Flags

CombineFlags meshes several flags into one so that all of them are set.

func FlagsFromString

func FlagsFromString(imapFlagString string) Flags

FlagsFromString returns the flags based on the input IMAP format string.

func (Flags) HasFlags

func (f Flags) HasFlags(check Flags) bool

HasFlags checks if the given flags are set.

func (Flags) ResetFlags

func (f Flags) ResetFlags(remove Flags) Flags

ResetFlags removes all set flags.

func (Flags) SetFlags

func (f Flags) SetFlags(add Flags) Flags

SetFlags sets the given flags.

func (Flags) String

func (f Flags) String() string

String converts flags to IMAP flag list string.

func (Flags) Strings

func (f Flags) Strings() []string

Strings convert flags to list of IMAP format flags.

type RFC2822Message

type RFC2822Message struct {
	Headers textproto.MIMEHeader
	Body    string
}

RFC2822Message is a message compliant with RFC 2822.

func MessageFromBytes

func MessageFromBytes(msgBytes []byte) (msg RFC2822Message, err error)

MessageFromBytes creates a RFC2822Message from its byte representation.

type SequenceNumber

type SequenceNumber string

SequenceNumber represents a single message identifier. Could be UID or sequence number. See RFC3501 section 9.

func (SequenceNumber) IsValue

func (s SequenceNumber) IsValue() bool

IsValue returns true if the sequence number is a numeral value and not nil or *.

func (SequenceNumber) Last

func (s SequenceNumber) Last() bool

Last returns true if this sequence number indicates the *last* sequence number or UID available in this mailbox. If false, this sequence number contains an integer value.

func (SequenceNumber) Nil

func (s SequenceNumber) Nil() bool

Nil returns true if no sequence number was specified.

func (SequenceNumber) Value

func (s SequenceNumber) Value() (uint32, error)

Value returns the integer value of the sequence number, if any is set. If Nil or Last is true (ie, this sequence number is not an integer value) then this returns 0 and an error.

type SequenceRange

type SequenceRange struct {
	Min SequenceNumber
	Max SequenceNumber
}

SequenceRange represents a range of identifiers. eg in IMAP: 5:9 or 15:*

func InterpretMessageRange

func InterpretMessageRange(imapMessageRange string) (seqRange SequenceRange, err error)

InterpretMessageRange creates a SequenceRange from the given string in the IMAP format.

type SequenceSet

type SequenceSet []SequenceRange

SequenceSet represents set of sequence ranges. eg in IMAP: 1,3,5:9,18:*

func InterpretSequenceSet

func InterpretSequenceSet(imapSequenceSet string) (seqSet SequenceSet, err error)

InterpretSequenceSet creates a SequenceSet from the given string in the IMAP format.

Jump to

Keyboard shortcuts

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