lib

package
v0.0.0-...-0798a42 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FlagToMaildir = map[models.Flags]maildir.Flag{
	models.AnsweredFlag: maildir.FlagReplied,
	models.SeenFlag:     maildir.FlagSeen,
	models.DeletedFlag:  maildir.FlagTrashed,
	models.FlaggedFlag:  maildir.FlagFlagged,
	models.DraftFlag:    maildir.FlagDraft,
}
View Source
var MaildirToFlag = map[maildir.Flag]models.Flags{
	maildir.FlagReplied: models.AnsweredFlag,
	maildir.FlagSeen:    models.SeenFlag,
	maildir.FlagTrashed: models.DeletedFlag,
	maildir.FlagFlagged: models.FlaggedFlag,
	maildir.FlagDraft:   models.DraftFlag,
}

Functions

func FileSize

func FileSize(name string) (uint32, error)

FileSize returns the size of the file specified by name

func FromMaildirFlags

func FromMaildirFlags(maildirFlags []maildir.Flag) models.Flags

func LimitHeaders

func LimitHeaders(hdr *mail.Header, fields []string, exclude bool) *mail.Header

LimitHeaders returns a new Header with the specified headers included or excluded

func ParseFolderMap

func ParseFolderMap(r io.Reader) (map[string]string, []string, error)
func Search(messages []rfc822.RawMessage, criteria *types.SearchCriteria) ([]uint32, error)

func SearchMessage

func SearchMessage(message rfc822.RawMessage, criteria *types.SearchCriteria,
	parts MsgParts,
) (bool, error)

searchMessage executes the search criteria for the given RawMessage, returns true if search succeeded

func Sort

func Sort(messageInfos []*models.MessageInfo,
	criteria []*types.SortCriterion,
) ([]uint32, error)

func StripUIDFromMessageFilename

func StripUIDFromMessageFilename(basename string) string

func ToMaildirFlags

func ToMaildirFlags(flags models.Flags) []maildir.Flag

Types

type MaildirStore

type MaildirStore struct {
	// contains filtered or unexported fields
}

func NewMaildirStore

func NewMaildirStore(root string, maildirpp bool) (*MaildirStore, error)

func (*MaildirStore) Dir

func (s *MaildirStore) Dir(name string) maildir.Dir

Folder returns a maildir.Dir with the specified name inside the Store

func (*MaildirStore) FolderMap

func (s *MaildirStore) FolderMap() (map[string]maildir.Dir, error)

type MsgParts

type MsgParts int

The parts of a message, kind of

const (
	FLAGS MsgParts = 1 << iota
	HEADER
	DATE
	BODY
	ALL
)
const NONE MsgParts = 0

func GetRequiredParts

func GetRequiredParts(criteria *types.SearchCriteria) MsgParts

Returns a bitmask of the parts of the message required to be loaded for the given criteria

Jump to

Keyboard shortcuts

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