Documentation
¶
Overview ¶
Package models defines shared data structures for email operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatMessageID ¶
FormatMessageID creates a message ID from components.
Types ¶
type AccountStatus ¶
type AccountStatus struct {
ID string `json:"id"`
Email string `json:"email"`
Connected bool `json:"connected"`
IsDefault bool `json:"isDefault"`
}
AccountStatus represents the status of an email account.
type AttachmentInfo ¶
type AttachmentInfo struct {
Index int `json:"index"`
Filename string `json:"filename"`
ContentType string `json:"contentType"`
Size int64 `json:"size"`
}
AttachmentInfo represents email attachment metadata.
type Email ¶
type Email struct {
ID string `json:"id"`
Subject string `json:"subject"`
From string `json:"from"`
To []string `json:"to"`
CC []string `json:"cc,omitempty"`
BCC []string `json:"bcc,omitempty"`
Date string `json:"date"`
Body string `json:"body,omitempty"`
ContentType string `json:"contentType,omitempty"`
Mailbox string `json:"mailbox"`
IsUnread bool `json:"isUnread"`
IsFlagged bool `json:"isFlagged"`
Attachments []AttachmentInfo `json:"attachments,omitempty"`
Account string `json:"account,omitempty"`
MessageIDHeader string `json:"messageIdHeader,omitempty"`
InReplyTo string `json:"inReplyTo,omitempty"`
References []string `json:"references,omitempty"`
}
Email represents an email message.
type EmailError ¶
type EmailError string
EmailError is a string-based error type for email operations.
const ( ErrInvalidMessageID EmailError = "invalid message ID format" ErrAccountNotFound EmailError = "account not found" ErrFolderNotFound EmailError = "folder not found" ErrMessageNotFound EmailError = "message not found" ErrAuthFailed EmailError = "authentication failed" ErrConnectionFailed EmailError = "connection failed" ErrTimeout EmailError = "operation timed out" ErrFolderRoleNotFound EmailError = "folder role not found" )
func (EmailError) Error ¶
func (e EmailError) Error() string
type Folder ¶
type Folder struct {
Name string `json:"name"`
Unread int `json:"unread"`
Total int `json:"total"`
Role FolderRole `json:"role,omitempty"`
}
Folder represents an email folder/mailbox.
type FolderRole ¶
type FolderRole string
FolderRole represents the special-use purpose of a folder (RFC 6154).
const ( RoleDrafts FolderRole = "\\Drafts" RoleTrash FolderRole = "\\Trash" RoleSent FolderRole = "\\Sent" RoleJunk FolderRole = "\\Junk" RoleArchive FolderRole = "\\Archive" )
Click to show internal directories.
Click to hide internal directories.