Skip to content

Commit

Permalink
imap: improve docs for various FETCH-related structs
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Jun 21, 2023
1 parent 37d2f29 commit 47d6339
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ type FetchOptions struct {
BinarySectionSize []*FetchItemBinarySectionSize // requires IMAP4rev2 or BINARY
}

// FetchItemBodyStructure contains FETCH options for the body structure.
type FetchItemBodyStructure struct {
Extended bool
}

// PartSpecifier describes whether to fetch a part's header, body, or both.
type PartSpecifier string

const (
Expand All @@ -33,6 +35,7 @@ const (
PartSpecifierText PartSpecifier = "TEXT"
)

// SectionPartial describes a byte range when fetching a message's payload.
type SectionPartial struct {
Offset, Size int64
}
Expand Down Expand Up @@ -167,16 +170,22 @@ func (bs *BodyStructureSinglePart) Filename() string {

func (*BodyStructureSinglePart) bodyStructure() {}

// BodyStructureMessageRFC822 contains metadata specific to RFC 822 parts for
// BodyStructureSinglePart.
type BodyStructureMessageRFC822 struct {
Envelope *Envelope
BodyStructure BodyStructure
NumLines int64
}

// BodyStructureText contains metadata specific to text parts for
// BodyStructureSinglePart.
type BodyStructureText struct {
NumLines int64
}

// BodyStructureSinglePartExt contains extended body structure data for
// BodyStructureSinglePart.
type BodyStructureSinglePartExt struct {
Disposition *BodyStructureDisposition
Language []string
Expand Down Expand Up @@ -230,13 +239,17 @@ func (bs *BodyStructureMultiPart) Disposition() *BodyStructureDisposition {

func (*BodyStructureMultiPart) bodyStructure() {}

// BodyStructureMultiPartExt contains extended body structure data for
// BodyStructureMultiPart.
type BodyStructureMultiPartExt struct {
Params map[string]string
Disposition *BodyStructureDisposition
Language []string
Location string
}

// BodyStructureDisposition describes the content disposition of a part
// (specified in the Content-Disposition header field).
type BodyStructureDisposition struct {
Value string
Params map[string]string
Expand Down

0 comments on commit 47d6339

Please sign in to comment.