Documentation ¶
Index ¶
- func NewConfig(configsPath string) (map[string]EmailConfig, error)
- type Crit
- type Defaults
- type EmailClient
- func (ec *EmailClient) AllInOneAuth(username string, config oauth2.Config) (oauth2.Token, error)
- func (ec *EmailClient) Authenticate(username string) error
- func (ec *EmailClient) DialTlsImap(imap string) error
- func (ec *EmailClient) GetBody(uid uint32, mbox string) (imap.Message, imap.BodySectionName, error)
- func (ec *EmailClient) GetByMessageId(messageId string, mbox string) ([]uint32, error)
- func (ec *EmailClient) GetByUID(uid uint32) ([]uint32, error)
- func (ec *EmailClient) GetEnvelopes(from uint32, to uint32) []Envelope
- func (ec *EmailClient) GetEnvelopesFromSeqArr(msgs []uint32, mailbox string) ([]Envelope, error)
- func (ec *EmailClient) GetEnvelopesFromUIDArr(msgs []uint32, mailbox string) ([]Envelope, error)
- func (ec *EmailClient) GetHtml(uid uint32, mbox string) (string, error)
- func (ec *EmailClient) GetLast(amount uint32, defaultInbox string) (uint32, uint32)
- func (ec *EmailClient) GetMailBoxes() ([]imap.MailboxInfo, error)
- func (ec *EmailClient) GetPage(page int32, perPage int32) (uint32, uint32)
- func (ec *EmailClient) GetPreview(uid uint32, previewCharSize int, mbox string) (MessagePart, error)
- func (ec *EmailClient) GetPreviewAndICS(uid uint32, previewCharSize int, mbox string) (MessagePart, MessagePart, error)
- func (ec *EmailClient) GetToken(code string, config *oauth2.Config) error
- func (ec *EmailClient) LogOut() error
- func (ec *EmailClient) ParseMessage(msg imap.Message, section imap.BodySectionName) (Message, error)
- func (ec *EmailClient) SearchByCrit(crit Crit) ([]uint32, error)
- func (ec *EmailClient) SelectMailBox(mName string) error
- func (ec *EmailClient) SendMail(smtpAddress string, to []string, bcc []string, cc []string, replyTo string, ...) error
- func (ec *EmailClient) SetTokenVals(accessToken, expiry, refreshToken string, tokenType string) error
- type EmailConfig
- type Envelope
- type Message
- type MessagePart
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Crit ¶
type Crit struct { Since time.Time Before time.Time SentSince time.Time SentBefore time.Time From []string To []string Bcc []string Cc []string Body []string Text []string WithFlags []string }
func (*Crit) ToSearchCriteria ¶
type EmailClient ¶
type EmailClient struct { Platform string Token *oauth2.Token Client *client.Client EmailAddress string Auth sasl.Client }
func NewEmailClient ¶
func NewEmailClient(cfg string) (EmailClient, error)
func (*EmailClient) AllInOneAuth ¶
func (*EmailClient) Authenticate ¶
func (ec *EmailClient) Authenticate(username string) error
func (*EmailClient) DialTlsImap ¶
func (ec *EmailClient) DialTlsImap(imap string) error
func (*EmailClient) GetBody ¶
func (ec *EmailClient) GetBody(uid uint32, mbox string) (imap.Message, imap.BodySectionName, error)
func (*EmailClient) GetByMessageId ¶
func (ec *EmailClient) GetByMessageId(messageId string, mbox string) ([]uint32, error)
func (*EmailClient) GetEnvelopes ¶
func (ec *EmailClient) GetEnvelopes(from uint32, to uint32) []Envelope
func (*EmailClient) GetEnvelopesFromSeqArr ¶
func (ec *EmailClient) GetEnvelopesFromSeqArr(msgs []uint32, mailbox string) ([]Envelope, error)
func (*EmailClient) GetEnvelopesFromUIDArr ¶
func (ec *EmailClient) GetEnvelopesFromUIDArr(msgs []uint32, mailbox string) ([]Envelope, error)
func (*EmailClient) GetHtml ¶
func (ec *EmailClient) GetHtml(uid uint32, mbox string) (string, error)
func (*EmailClient) GetLast ¶
func (ec *EmailClient) GetLast(amount uint32, defaultInbox string) (uint32, uint32)
func (*EmailClient) GetMailBoxes ¶
func (ec *EmailClient) GetMailBoxes() ([]imap.MailboxInfo, error)
func (*EmailClient) GetPage ¶
func (ec *EmailClient) GetPage(page int32, perPage int32) (uint32, uint32)
func (*EmailClient) GetPreview ¶
func (ec *EmailClient) GetPreview(uid uint32, previewCharSize int, mbox string) (MessagePart, error)
func (*EmailClient) GetPreviewAndICS ¶
func (ec *EmailClient) GetPreviewAndICS(uid uint32, previewCharSize int, mbox string) (MessagePart, MessagePart, error)
func (*EmailClient) GetToken ¶
func (ec *EmailClient) GetToken(code string, config *oauth2.Config) error
func (*EmailClient) LogOut ¶
func (ec *EmailClient) LogOut() error
func (*EmailClient) ParseMessage ¶
func (ec *EmailClient) ParseMessage(msg imap.Message, section imap.BodySectionName) (Message, error)
func (*EmailClient) SearchByCrit ¶
func (ec *EmailClient) SearchByCrit(crit Crit) ([]uint32, error)
func (*EmailClient) SelectMailBox ¶
func (ec *EmailClient) SelectMailBox(mName string) error
func (*EmailClient) SetTokenVals ¶
func (ec *EmailClient) SetTokenVals(accessToken, expiry, refreshToken string, tokenType string) error
type EmailConfig ¶
type Message ¶
type Message struct { Attachments []MessagePart Html MessagePart Raw MessagePart Header mail.Header }
type MessagePart ¶
Click to show internal directories.
Click to hide internal directories.