Documentation ¶
Index ¶
- func Configure(cfg *m2a.Config, router *mux.Router)
- func FoldersHandler(resp http.ResponseWriter, req *http.Request)
- func GetImapClient(resp http.ResponseWriter, req *http.Request) *imap.Client
- func GetLastUIDs(alluids []uint32) *imap.SeqSet
- func GetUIDs(mbox string, client *imap.Client) ([]uint32, error)
- func MessageHandler(resp http.ResponseWriter, req *http.Request)
- func SendErrorPayload(err string, resp http.ResponseWriter)
- func SetAjaxHeaders(w http.ResponseWriter)
- func SummaryHandler(resp http.ResponseWriter, req *http.Request)
- type ErrorPayload
- type Folder
- type FoldersPayload
- type Header
- type MbLogin
- type Message
- type MessagePayload
- type SummaryPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FoldersHandler ¶
func FoldersHandler(resp http.ResponseWriter, req *http.Request)
Handle /mailbox/<email>/folders
func GetImapClient ¶
== Check credentials of account via db, and connect with IMAP (shorter timeout)
func GetLastUIDs ¶
func MessageHandler ¶
func MessageHandler(resp http.ResponseWriter, req *http.Request)
func SendErrorPayload ¶
func SendErrorPayload(err string, resp http.ResponseWriter)
func SetAjaxHeaders ¶
func SetAjaxHeaders(w http.ResponseWriter)
Content-Type to json, and allow origin
func SummaryHandler ¶
func SummaryHandler(resp http.ResponseWriter, req *http.Request)
Types ¶
type ErrorPayload ¶
===============================================
type FoldersPayload ¶
type Header ¶
type Header struct { Uid uint32 `json:"uid"` FromName string `json:"from_name"` FromEmail string `json:"from_email"` Subject string `json:"subject"` Date string `json:"date"` Seen bool `json:"seen"` Flagged bool `json:"flagged"` Answered bool `json:"answered"` }
===================================================================
type Message ¶
type Message struct { Uid uint32 `json:"uid"` Folder string `json:"folder"` FromName string `json:"from_name"` FromEmail string `json:"from_email"` Date string `json:"date"` Seen bool `json:"seen"` Flagged bool `json:"flagged"` Answered bool `json:"answered"` Subject string `json:"subject"` BodyHtml string `json:"body_html"` BodyText string `json:"body_text"` ContentType string `json:"content_type"` }
===================================================================
type MessagePayload ¶
Click to show internal directories.
Click to hide internal directories.