Documentation
¶
Index ¶
- Variables
- type AccountAddedMsg
- type AccountDeletedMsg
- type AccountTab
- type AddAccountMsg
- type AllEmailsFetchedMsg
- type ArchiveEmailMsg
- type AttachmentDownloadedMsg
- type BackToInboxMsg
- type BackToMailboxMsg
- type CachedEmailsLoadedMsg
- type CancelFilePickerMsg
- type Choice
- type ChooseServiceMsg
- type ClearStatusMsg
- type Composer
- func (m *Composer) GetAttachmentPath() string
- func (m *Composer) GetBody() string
- func (m *Composer) GetDraftID() string
- func (m *Composer) GetInReplyTo() string
- func (m *Composer) GetReferences() []string
- func (m *Composer) GetSelectedAccountID() string
- func (m *Composer) GetSubject() string
- func (m *Composer) GetTo() string
- func (m *Composer) Init() tea.Cmd
- func (m *Composer) ResetConfirmation()
- func (m *Composer) SetAccounts(accounts []config.Account)
- func (m *Composer) SetDraftID(id string)
- func (m *Composer) SetReplyContext(inReplyTo string, references []string)
- func (m *Composer) SetSelectedAccount(accountID string)
- func (m *Composer) ToDraft() config.Draft
- func (m *Composer) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *Composer) View() string
- type Credentials
- type DeleteAccountMsg
- type DeleteEmailMsg
- type DeleteSavedDraftMsg
- type DiscardDraftMsg
- type DownloadAttachmentMsg
- type DraftDeletedMsg
- type DraftSavedMsg
- type Drafts
- type DraftsLoadedMsg
- type EmailActionDoneMsg
- type EmailBodyFetchedMsg
- type EmailResultMsg
- type EmailView
- type EmailsAppendedMsg
- type EmailsFetchedMsg
- type EmailsRefreshedMsg
- type FetchErr
- type FetchMoreEmailsMsg
- type FetchingMoreEmailsMsg
- type FilePicker
- type FileSelectedMsg
- type GoToAccountListMsg
- type GoToAddAccountMsg
- type GoToChoiceMenuMsg
- type GoToDraftsMsg
- type GoToFilePickerMsg
- type GoToInboxMsg
- type GoToSendMsg
- type GoToSentInboxMsg
- type GoToSettingsMsg
- type Inbox
- func NewInbox(emails []fetcher.Email, accounts []config.Account) *Inbox
- func NewInboxSingleAccount(emails []fetcher.Email) *Inbox
- func NewInboxWithMailbox(emails []fetcher.Email, accounts []config.Account, mailbox MailboxKind) *Inbox
- func NewSentInbox(emails []fetcher.Email, accounts []config.Account) *Inbox
- func (m *Inbox) GetCurrentAccountID() string
- func (m *Inbox) GetEmailAtIndex(index int) *fetcher.Email
- func (m *Inbox) GetMailbox() MailboxKind
- func (m *Inbox) Init() tea.Cmd
- func (m *Inbox) RemoveEmail(uid uint32, accountID string)
- func (m *Inbox) SetEmails(emails []fetcher.Email, accounts []config.Account)
- func (m *Inbox) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *Inbox) View() string
- type LoadDraftsMsg
- type Login
- func (m *Login) GetAccountID() string
- func (m *Login) Init() tea.Cmd
- func (m *Login) IsEditMode() bool
- func (m *Login) SetEditMode(accountID, provider, name, email, fetchEmail, imapServer string, imapPort int, ...)
- func (m *Login) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *Login) View() string
- type MailboxKind
- type OpenDraftMsg
- type RefreshingEmailsMsg
- type ReplyToEmailMsg
- type RequestRefreshMsg
- type RestoreViewMsg
- type SaveDraftMsg
- type SendEmailMsg
- type SetComposerCursorToStartMsg
- type Settings
- type Status
- type SwitchAccountMsg
- type SwitchFromAccountMsg
- type ViewEmailMsg
Constants ¶
This section is empty.
Variables ¶
var ( DialogBoxStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(lipgloss.Color("#25A065")). Padding(1, 0). BorderTop(true). BorderLeft(true). BorderRight(true). BorderBottom(true) HelpStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("240")) SuccessStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("42")).Bold(true) InfoStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("42")).Bold(true) H1Style = lipgloss.NewStyle(). Foreground(lipgloss.Color("42")). Bold(true). Align(lipgloss.Center) H2Style = lipgloss.NewStyle(). Foreground(lipgloss.Color("42")). Bold(false). Align(lipgloss.Center) BodyStyle = lipgloss.NewStyle(). Bold(true) // A bit bold )
var DocStyle = lipgloss.NewStyle().Margin(1, 2)
Functions ¶
This section is empty.
Types ¶
type AccountAddedMsg ¶ added in v0.8.0
AccountAddedMsg signals that an account was successfully added.
type AccountDeletedMsg ¶ added in v0.8.0
AccountDeletedMsg signals that an account was successfully deleted.
type AccountTab ¶ added in v0.8.0
AccountTab represents a tab for an account
type AddAccountMsg ¶ added in v0.8.0
type AddAccountMsg struct {
Credentials Credentials
}
AddAccountMsg signals that a new account should be added.
type AllEmailsFetchedMsg ¶ added in v0.8.0
type AllEmailsFetchedMsg struct {
EmailsByAccount map[string][]fetcher.Email
Mailbox MailboxKind
}
AllEmailsFetchedMsg signals that emails from all accounts have been fetched.
type ArchiveEmailMsg ¶
type ArchiveEmailMsg struct {
UID uint32
AccountID string
Mailbox MailboxKind
}
type AttachmentDownloadedMsg ¶
type BackToInboxMsg ¶
type BackToInboxMsg struct{}
type BackToMailboxMsg ¶ added in v0.10.0
type BackToMailboxMsg struct {
Mailbox MailboxKind
}
type CachedEmailsLoadedMsg ¶ added in v0.8.0
type CachedEmailsLoadedMsg struct {
Cache *config.EmailCache
}
CachedEmailsLoadedMsg signals that cached emails were loaded from disk.
type CancelFilePickerMsg ¶
type CancelFilePickerMsg struct{}
type Choice ¶
type ChooseServiceMsg ¶
type ChooseServiceMsg struct {
Service string
}
type ClearStatusMsg ¶
type ClearStatusMsg struct{}
type Composer ¶
type Composer struct {
// contains filtered or unexported fields
}
Composer model holds the state of the email composition UI.
func NewComposer ¶
NewComposer initializes a new composer model.
func NewComposerFromDraft ¶ added in v0.8.0
NewComposerFromDraft creates a composer from an existing draft.
func NewComposerWithAccounts ¶ added in v0.8.0
func NewComposerWithAccounts(accounts []config.Account, selectedAccountID string, to, subject, body string) *Composer
NewComposerWithAccounts initializes a composer with multiple account support.
func (*Composer) GetAttachmentPath ¶ added in v0.8.0
GetAttachmentPath returns the current attachment path.
func (*Composer) GetDraftID ¶ added in v0.8.0
GetDraftID returns the draft ID for this composer.
func (*Composer) GetInReplyTo ¶ added in v0.8.0
GetInReplyTo returns the In-Reply-To header value.
func (*Composer) GetReferences ¶ added in v0.8.0
GetReferences returns the References header values.
func (*Composer) GetSelectedAccountID ¶ added in v0.8.0
GetSelectedAccountID returns the ID of the currently selected account.
func (*Composer) GetSubject ¶ added in v0.8.0
GetSubject returns the current Subject field value.
func (*Composer) ResetConfirmation ¶
func (m *Composer) ResetConfirmation()
ResetConfirmation ensures a restored draft isn't stuck in the exit prompt.
func (*Composer) SetAccounts ¶ added in v0.8.0
SetAccounts sets the available accounts for sending.
func (*Composer) SetDraftID ¶ added in v0.8.0
SetDraftID sets the draft ID (for loading existing drafts).
func (*Composer) SetReplyContext ¶ added in v0.8.0
SetReplyContext sets the reply context for the draft.
func (*Composer) SetSelectedAccount ¶ added in v0.8.0
SetSelectedAccount sets the selected account by ID.
type Credentials ¶
type Credentials struct {
Provider string
Name string
Host string // Host (this was the previous \"Email Address\" field in the UI)
FetchEmail string // Single email address to fetch messages for. If empty, code should default this to Host when creating the account.
Password string
IMAPServer string
IMAPPort int
SMTPServer string
SMTPPort int
}
type DeleteAccountMsg ¶ added in v0.8.0
type DeleteAccountMsg struct {
AccountID string
}
DeleteAccountMsg signals that an account should be deleted.
type DeleteEmailMsg ¶
type DeleteEmailMsg struct {
UID uint32
AccountID string
Mailbox MailboxKind
}
type DeleteSavedDraftMsg ¶ added in v0.8.0
type DeleteSavedDraftMsg struct {
DraftID string
}
DeleteDraftMsg signals that a draft should be deleted.
type DiscardDraftMsg ¶
type DiscardDraftMsg struct {
ComposerState *Composer
}
DiscardDraftMsg signals that a draft should be cached.
type DownloadAttachmentMsg ¶
type DraftDeletedMsg ¶ added in v0.8.0
DraftDeletedMsg signals that a draft was deleted.
type DraftSavedMsg ¶ added in v0.8.0
DraftSavedMsg signals that a draft was saved successfully.
type Drafts ¶ added in v0.8.0
type Drafts struct {
// contains filtered or unexported fields
}
Drafts is the model for the drafts list view
type DraftsLoadedMsg ¶ added in v0.8.0
DraftsLoadedMsg signals that drafts were loaded from disk.
type EmailActionDoneMsg ¶
type EmailActionDoneMsg struct {
UID uint32
AccountID string
Mailbox MailboxKind
Err error
}
type EmailBodyFetchedMsg ¶
type EmailBodyFetchedMsg struct {
UID uint32
Body string
Attachments []fetcher.Attachment
Err error
AccountID string
Mailbox MailboxKind
}
type EmailResultMsg ¶
type EmailResultMsg struct {
Err error
}
type EmailView ¶
type EmailView struct {
// contains filtered or unexported fields
}
func NewEmailView ¶
func NewEmailView(email fetcher.Email, emailIndex, width, height int, mailbox MailboxKind) *EmailView
func (*EmailView) GetAccountID ¶ added in v0.8.0
GetAccountID returns the account ID for this email
type EmailsAppendedMsg ¶
type EmailsAppendedMsg struct {
Emails []fetcher.Email
AccountID string
Mailbox MailboxKind
}
type EmailsFetchedMsg ¶
type EmailsFetchedMsg struct {
Emails []fetcher.Email
AccountID string
Mailbox MailboxKind
}
type EmailsRefreshedMsg ¶ added in v0.8.0
type EmailsRefreshedMsg struct {
EmailsByAccount map[string][]fetcher.Email
Mailbox MailboxKind
}
EmailsRefreshedMsg signals that fresh emails have been fetched in the background.
type FetchMoreEmailsMsg ¶
type FetchMoreEmailsMsg struct {
Offset uint32
AccountID string
Mailbox MailboxKind
}
type FetchingMoreEmailsMsg ¶
type FetchingMoreEmailsMsg struct{}
type FilePicker ¶
type FilePicker struct {
// contains filtered or unexported fields
}
func NewFilePicker ¶
func NewFilePicker(startPath string) *FilePicker
func (*FilePicker) Init ¶
func (m *FilePicker) Init() tea.Cmd
func (*FilePicker) View ¶
func (m *FilePicker) View() string
type FileSelectedMsg ¶
type FileSelectedMsg struct {
Path string
}
type GoToAccountListMsg ¶ added in v0.8.0
type GoToAccountListMsg struct{}
GoToAccountListMsg signals navigation to the account list in settings.
type GoToAddAccountMsg ¶ added in v0.8.0
type GoToAddAccountMsg struct{}
GoToAddAccountMsg signals navigation to the add account screen.
type GoToChoiceMenuMsg ¶
type GoToChoiceMenuMsg struct{}
type GoToDraftsMsg ¶ added in v0.8.0
type GoToDraftsMsg struct{}
GoToDraftsMsg signals navigation to the drafts list.
type GoToFilePickerMsg ¶
type GoToFilePickerMsg struct{}
type GoToInboxMsg ¶
type GoToInboxMsg struct{}
type GoToSendMsg ¶
type GoToSentInboxMsg ¶ added in v0.10.0
type GoToSentInboxMsg struct{}
type GoToSettingsMsg ¶
type GoToSettingsMsg struct{}
type Inbox ¶
type Inbox struct {
// contains filtered or unexported fields
}
func NewInboxSingleAccount ¶ added in v0.8.0
NewInboxSingleAccount creates an inbox for a single account (legacy support)
func NewInboxWithMailbox ¶ added in v0.10.0
func NewSentInbox ¶ added in v0.10.0
func (*Inbox) GetCurrentAccountID ¶ added in v0.8.0
GetCurrentAccountID returns the currently selected account ID
func (*Inbox) GetEmailAtIndex ¶ added in v0.8.0
GetEmailAtIndex returns the email at the given index for the current view
func (*Inbox) GetMailbox ¶ added in v0.10.0
func (m *Inbox) GetMailbox() MailboxKind
func (*Inbox) RemoveEmail ¶ added in v0.8.0
RemoveEmail removes an email by UID and account ID
type LoadDraftsMsg ¶ added in v0.8.0
type LoadDraftsMsg struct{}
LoadDraftsMsg signals a request to load all saved drafts.
type Login ¶
type Login struct {
// contains filtered or unexported fields
}
Login holds the state for the login/add account form.
func (*Login) GetAccountID ¶ added in v0.8.0
GetAccountID returns the account ID being edited (if in edit mode).
func (*Login) IsEditMode ¶ added in v0.8.0
IsEditMode returns whether the form is in edit mode.
func (*Login) SetEditMode ¶ added in v0.8.0
func (m *Login) SetEditMode(accountID, provider, name, email, fetchEmail, imapServer string, imapPort int, smtpServer string, smtpPort int)
SetEditMode sets the login form to edit an existing account.
type MailboxKind ¶ added in v0.10.0
type MailboxKind string
const ( MailboxInbox MailboxKind = "inbox" MailboxSent MailboxKind = "sent" )
type OpenDraftMsg ¶ added in v0.8.0
OpenDraftMsg signals that a specific draft should be opened in the composer.
type RefreshingEmailsMsg ¶ added in v0.8.0
type RefreshingEmailsMsg struct {
Mailbox MailboxKind
}
RefreshingEmailsMsg signals that a background refresh is in progress.
type ReplyToEmailMsg ¶
type RequestRefreshMsg ¶ added in v0.13.0
type RequestRefreshMsg struct {
Mailbox MailboxKind
}
RequestRefreshMsg signals a request to refresh emails from the server.
type RestoreViewMsg ¶
type RestoreViewMsg struct{}
type SaveDraftMsg ¶ added in v0.8.0
SaveDraftMsg signals that the current draft should be saved to disk.
type SendEmailMsg ¶
type SetComposerCursorToStartMsg ¶
type SetComposerCursorToStartMsg struct{}
type Settings ¶ added in v0.8.0
type Settings struct {
// contains filtered or unexported fields
}
Settings displays the account management screen.
func NewSettings ¶ added in v0.8.0
NewSettings creates a new settings model.
func (*Settings) UpdateAccounts ¶ added in v0.8.0
UpdateAccounts updates the list of accounts.
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
A simple model for showing a status message
type SwitchAccountMsg ¶ added in v0.8.0
type SwitchAccountMsg struct {
AccountID string // Empty string means "ALL" accounts
}
SwitchAccountMsg signals switching to view a specific account's inbox.
type SwitchFromAccountMsg ¶ added in v0.8.0
type SwitchFromAccountMsg struct {
AccountID string
}
SwitchFromAccountMsg signals changing the "From" account in composer.
type ViewEmailMsg ¶
type ViewEmailMsg struct {
Index int
UID uint32
AccountID string
Mailbox MailboxKind
}