messages.go

 1package tui
 2
 3import "github.com/andrinoff/email-cli/fetcher"
 4
 5// A message to view an email.
 6type ViewEmailMsg struct {
 7	Index int
 8}
 9
10// A message to indicate that an email has been sent.
11type SendEmailMsg struct {
12	To      string
13	Subject string
14	Body    string
15}
16
17// A message to indicate that the user has entered their credentials.
18type Credentials struct {
19	Provider string
20	Name     string
21	Email    string
22	Password string
23}
24
25// A message to indicate that the user has chosen a service.
26type ChooseServiceMsg struct {
27	Service string
28}
29
30// EmailResultMsg is sent after an email sending attempt.
31// If Err is not nil, the email failed to send.
32type EmailResultMsg struct {
33	Err error
34}
35
36// ClearStatusMsg is sent to clear the status message from the view.
37type ClearStatusMsg struct{}
38
39// A message containing the fetched emails.
40type EmailsFetchedMsg struct {
41	Emails []fetcher.Email
42}
43
44// A message to indicate that an error occurred while fetching emails.
45type FetchErr error
46
47// A message to navigate to the inbox view.
48type GoToInboxMsg struct{}
49
50// A message to navigate to the composer view.
51type GoToSendMsg struct{}
52
53// A message to navigate to the settings view.
54type GoToSettingsMsg struct{}