models

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Roles = map[string]Role{
	"all":     AllRole,
	"archive": ArchiveRole,
	"drafts":  DraftsRole,
	"inbox":   InboxRole,
	"junk":    JunkRole,
	"sent":    SentRole,
	"trash":   TrashRole,
	"query":   QueryRole,
}

Functions

This section is empty.

Types

type BodyStructure

type BodyStructure struct {
	MIMEType          string
	MIMESubType       string
	Params            map[string]string
	Description       string
	Encoding          string
	Parts             []*BodyStructure
	Disposition       string
	DispositionParams map[string]string
}

func (*BodyStructure) FileName

func (bs *BodyStructure) FileName() string

func (*BodyStructure) FullMIMEType

func (bs *BodyStructure) FullMIMEType() string

func (*BodyStructure) PartAtIndex

func (bs *BodyStructure) PartAtIndex(index []int) (*BodyStructure, error)

PartAtIndex returns the BodyStructure at the requested index

type Capabilities

type Capabilities struct {
	Sort   bool
	Thread bool
}

Capabilities provides the backend capabilities

type Case

type Case interface {
	Matches(string) bool
	Value() string
	Skip() bool
}

type Directory

type Directory struct {
	Name string
	// Exists messages in the Directory
	Exists int
	// Recent messages in the Directory
	Recent int
	// Unseen messages in the Directory
	Unseen int
	// IANA role
	Role Role
}

type DirectoryInfo

type DirectoryInfo struct {
	Name string
	// The total number of messages in this mailbox.
	Exists int
	// The number of messages not seen since the last time the mailbox was opened.
	Recent int
	// The number of unread messages
	Unseen int
}

type Envelope

type Envelope struct {
	Date      time.Time
	Subject   string
	From      []*mail.Address
	ReplyTo   []*mail.Address
	To        []*mail.Address
	Cc        []*mail.Address
	Bcc       []*mail.Address
	MessageId string
	InReplyTo string
}

type Flags

type Flags uint32

Flags is an abstraction around the different flags which can be present in different email backends and represents a flag that we use in the UI.

const (
	// SeenFlag marks a message as having been seen previously
	SeenFlag Flags = 1 << iota

	// RecentFlag marks a message as being recent
	RecentFlag

	// AnsweredFlag marks a message as having been replied to
	AnsweredFlag

	// DeletedFlag marks a message as having been deleted
	DeletedFlag

	// FlaggedFlag marks a message with a user flag
	FlaggedFlag

	// DraftFlag marks a message as a draft
	DraftFlag
)

func (Flags) Has

func (f Flags) Has(flags Flags) bool

type FullMessage

type FullMessage struct {
	Reader io.Reader
	Uid    uint32
}

A FullMessage is the entire message

type MessageBodyPart

type MessageBodyPart struct {
	Reader io.Reader
	Uid    uint32
}

A MessageBodyPart can be displayed in the message viewer

type MessageDetails

type MessageDetails struct {
	IsEncrypted        bool
	IsSigned           bool
	SignedBy           string // Primary identity of signing key
	SignedByKeyId      uint64
	SignatureValidity  SignatureValidity
	SignatureError     string
	DecryptedWith      string // Primary Identity of decryption key
	DecryptedWithKeyId uint64 // Public key id of decryption key
	Body               io.Reader
	Micalg             string
}

type MessageInfo

type MessageInfo struct {
	BodyStructure *BodyStructure
	Envelope      *Envelope
	Flags         Flags
	Labels        []string
	Filenames     []string
	InternalDate  time.Time
	RFC822Headers *mail.Header
	Refs          []string
	Size          uint32
	Uid           uint32
	Error         error
}

A MessageInfo holds information about the structure of a message

func (*MessageInfo) InReplyTo

func (mi *MessageInfo) InReplyTo() (msgid string, err error)

func (*MessageInfo) MsgId

func (mi *MessageInfo) MsgId() (msgid string, err error)

func (*MessageInfo) References

func (mi *MessageInfo) References() ([]string, error)

type OriginalMail

type OriginalMail struct {
	Date          time.Time
	From          string
	Text          string
	MIMEType      string
	RFC822Headers *mail.Header
}

OriginalMail is helper struct used for reply/forward

type Role

type Role string
const (
	AllRole     Role = "all"
	ArchiveRole Role = "archive"
	DraftsRole  Role = "drafts"
	InboxRole   Role = "inbox"
	JunkRole    Role = "junk"
	SentRole    Role = "sent"
	TrashRole   Role = "trash"
	// Custom aerc roles
	QueryRole Role = "query"
	// virtual node created by the directory tree
	VirtualRole Role = "virtual"
)

type SignatureValidity

type SignatureValidity int32
const (
	UnknownValidity SignatureValidity = iota
	Valid
	InvalidSignature
	UnknownEntity
	UnsupportedMicalg
	MicalgMismatch
)

type TemplateData

type TemplateData interface {
	Account() string
	Folder() string
	To() []*mail.Address
	Cc() []*mail.Address
	Bcc() []*mail.Address
	From() []*mail.Address
	Peer() []*mail.Address
	ReplyTo() []*mail.Address
	Date() time.Time
	DateAutoFormat(date time.Time) string
	Header(name string) string
	ThreadPrefix() string
	ThreadCount() int
	ThreadUnread() int
	ThreadFolded() bool
	ThreadContext() bool
	Subject() string
	SubjectBase() string
	Number() int
	Labels() []string
	Filename() string
	Filenames() []string
	Flags() []string
	IsReplied() bool
	HasAttachment() bool
	Attach(string) string
	IsFlagged() bool
	IsRecent() bool
	IsUnread() bool
	IsMarked() bool
	IsDraft() bool
	MessageId() string
	Role() string
	Size() int
	OriginalText() string
	OriginalDate() time.Time
	OriginalFrom() []*mail.Address
	OriginalMIMEType() string
	OriginalHeader(name string) string
	Recent(folders ...string) int
	Unread(folders ...string) int
	Exists(folders ...string) int
	RUE(folders ...string) string
	Connected() bool
	ConnectionInfo() string
	ContentInfo() string
	StatusInfo() string
	TrayInfo() string
	PendingKeys() string
	Style(string, string) string
	StyleSwitch(string, ...Case) string
	StyleMap([]string, ...Case) []string
	Signature() string
}

This interface needs to be implemented for compliance with aerc-templates(7)

Jump to

Keyboard shortcuts

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