Documentation ¶
Index ¶
- type IMAPBackend
- type IMAPClient
- func (c *IMAPClient) AddFlags(ids, flags string) *IMAPResponse
- func (c *IMAPClient) Append(mailboxName, msg string) *IMAPResponse
- func (c *IMAPClient) AppendBody(mailboxName, subject, from, to, body string) *IMAPResponse
- func (c *IMAPClient) Close()
- func (c *IMAPClient) Copy(ids, newMailboxName string) *IMAPResponse
- func (c *IMAPClient) CreateMailbox(mailboxName string) *IMAPResponse
- func (c *IMAPClient) DeleteMailbox(mailboxName string) *IMAPResponse
- func (c *IMAPClient) Expunge() *IMAPResponse
- func (c *IMAPClient) ExpungeUID(ids string) *IMAPResponse
- func (c *IMAPClient) Fetch(ids, parts string) *IMAPResponse
- func (c *IMAPClient) FetchAll(parts string) *IMAPResponse
- func (c *IMAPClient) FetchAllBodies() *IMAPResponse
- func (c *IMAPClient) FetchAllBodyStructures() *IMAPResponse
- func (c *IMAPClient) FetchAllFlags() *IMAPResponse
- func (c *IMAPClient) FetchAllHeaders() *IMAPResponse
- func (c *IMAPClient) FetchAllSizes() *IMAPResponse
- func (c *IMAPClient) FetchAllSubjects() *IMAPResponse
- func (c *IMAPClient) FetchUID(ids, parts string) *IMAPResponse
- func (c *IMAPClient) GetMailboxInfo(mailboxName string) *IMAPResponse
- func (c *IMAPClient) GetMailboxStatus(mailboxName string) *IMAPResponse
- func (c *IMAPClient) ID(request string) *IMAPResponse
- func (c *IMAPClient) ListMailboxes() *IMAPResponse
- func (c *IMAPClient) Login(account, password string) *IMAPResponse
- func (c *IMAPClient) Logout() *IMAPResponse
- func (c *IMAPClient) MarkAsDeleted(ids string) *IMAPResponse
- func (c *IMAPClient) MarkAsRead(ids string) *IMAPResponse
- func (c *IMAPClient) MarkAsStarred(ids string) *IMAPResponse
- func (c *IMAPClient) MarkAsUndeleted(ids string) *IMAPResponse
- func (c *IMAPClient) MarkAsUnread(ids string) *IMAPResponse
- func (c *IMAPClient) MarkAsUnstarred(ids string) *IMAPResponse
- func (c *IMAPClient) Move(ids, newMailboxName string) *IMAPResponse
- func (c *IMAPClient) Noop() *IMAPResponse
- func (c *IMAPClient) RemoveFlags(ids, flags string) *IMAPResponse
- func (c *IMAPClient) RenameMailbox(mailboxName, newMailboxName string) *IMAPResponse
- func (c *IMAPClient) Search(query string) *IMAPResponse
- func (c *IMAPClient) Select(mailboxName string) *IMAPResponse
- func (c *IMAPClient) SendCommand(command string) *IMAPResponse
- func (c *IMAPClient) SetFlags(ids, flags string) *IMAPResponse
- func (c *IMAPClient) StartIDLE() *IMAPResponse
- func (c *IMAPClient) StopIDLE()
- type IMAPMailbox
- func (m *IMAPMailbox) Check() error
- func (m *IMAPMailbox) CopyMessages(uid bool, seqset *imap.SeqSet, dest string) error
- func (m *IMAPMailbox) CreateMessage(flags []string, date time.Time, body imap.Literal) error
- func (m *IMAPMailbox) Expunge() error
- func (m *IMAPMailbox) Info() (*imap.MailboxInfo, error)
- func (m *IMAPMailbox) ListMessages(uid bool, seqset *imap.SeqSet, items []imap.FetchItem, ch chan<- *imap.Message) error
- func (m *IMAPMailbox) Name() string
- func (m *IMAPMailbox) SearchMessages(uid bool, criteria *imap.SearchCriteria) ([]uint32, error)
- func (m *IMAPMailbox) SetSubscribed(subscribed bool) error
- func (m *IMAPMailbox) Status(items []imap.StatusItem) (*imap.MailboxStatus, error)
- func (m *IMAPMailbox) UpdateMessagesFlags(uid bool, seqset *imap.SeqSet, operation imap.FlagsOp, flags []string) error
- type IMAPResponse
- func (ir *IMAPResponse) AssertError(wantErrMsg string) *IMAPResponse
- func (ir *IMAPResponse) AssertNotSections(unwantedRegexps ...string) *IMAPResponse
- func (ir *IMAPResponse) AssertOK() *IMAPResponse
- func (ir *IMAPResponse) AssertResult(wantResult string) *IMAPResponse
- func (ir *IMAPResponse) AssertSections(wantRegexps ...string) *IMAPResponse
- func (ir *IMAPResponse) AssertSectionsCount(expectedCount int) *IMAPResponse
- func (ir *IMAPResponse) AssertSectionsInOrder(wantRegexps ...string) *IMAPResponse
- func (ir *IMAPResponse) HasSections(wantRegexps ...string) bool
- func (ir *IMAPResponse) Sections() []string
- func (ir *IMAPResponse) WaitForNotSections(timeout time.Duration, unwantedRegexps ...string) *IMAPResponse
- func (ir *IMAPResponse) WaitForSections(timeout time.Duration, wantRegexps ...string)
- type IMAPServer
- type IMAPUser
- func (u *IMAPUser) CreateMailbox(name string) error
- func (u *IMAPUser) DeleteMailbox(name string) error
- func (u *IMAPUser) GetMailbox(name string) (imapbackend.Mailbox, error)
- func (u *IMAPUser) ListMailboxes(subscribed bool) ([]imapbackend.Mailbox, error)
- func (u *IMAPUser) Logout() error
- func (u *IMAPUser) RenameMailbox(existingName, newName string) error
- func (u *IMAPUser) Username() string
- type SMTPClient
- func (c *SMTPClient) Close()
- func (c *SMTPClient) EML(fileName, bcc string) *SMTPResponse
- func (c *SMTPClient) Login(account, password string) *SMTPResponse
- func (c *SMTPClient) Logout() *SMTPResponse
- func (c *SMTPClient) SendCommands(commands ...string) *SMTPResponse
- func (c *SMTPClient) SendMail(r io.Reader, bcc string) *SMTPResponse
- type SMTPResponse
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMAPBackend ¶
type IMAPBackend struct {
// contains filtered or unexported fields
}
func (*IMAPBackend) Login ¶
func (b *IMAPBackend) Login(connInfo *imap.ConnInfo, username, password string) (imapbackend.User, error)
type IMAPClient ¶
type IMAPClient struct {
// contains filtered or unexported fields
}
func NewIMAPClient ¶
func NewIMAPClient(t TestingT, tag string, imapAddr string) *IMAPClient
func (*IMAPClient) AddFlags ¶
func (c *IMAPClient) AddFlags(ids, flags string) *IMAPResponse
func (*IMAPClient) Append ¶
func (c *IMAPClient) Append(mailboxName, msg string) *IMAPResponse
func (*IMAPClient) AppendBody ¶
func (c *IMAPClient) AppendBody(mailboxName, subject, from, to, body string) *IMAPResponse
func (*IMAPClient) Close ¶
func (c *IMAPClient) Close()
func (*IMAPClient) Copy ¶
func (c *IMAPClient) Copy(ids, newMailboxName string) *IMAPResponse
func (*IMAPClient) CreateMailbox ¶
func (c *IMAPClient) CreateMailbox(mailboxName string) *IMAPResponse
func (*IMAPClient) DeleteMailbox ¶
func (c *IMAPClient) DeleteMailbox(mailboxName string) *IMAPResponse
func (*IMAPClient) Expunge ¶
func (c *IMAPClient) Expunge() *IMAPResponse
func (*IMAPClient) ExpungeUID ¶ added in v1.6.3
func (c *IMAPClient) ExpungeUID(ids string) *IMAPResponse
func (*IMAPClient) Fetch ¶
func (c *IMAPClient) Fetch(ids, parts string) *IMAPResponse
func (*IMAPClient) FetchAll ¶
func (c *IMAPClient) FetchAll(parts string) *IMAPResponse
func (*IMAPClient) FetchAllBodies ¶
func (c *IMAPClient) FetchAllBodies() *IMAPResponse
func (*IMAPClient) FetchAllBodyStructures ¶
func (c *IMAPClient) FetchAllBodyStructures() *IMAPResponse
func (*IMAPClient) FetchAllFlags ¶
func (c *IMAPClient) FetchAllFlags() *IMAPResponse
func (*IMAPClient) FetchAllHeaders ¶
func (c *IMAPClient) FetchAllHeaders() *IMAPResponse
func (*IMAPClient) FetchAllSizes ¶
func (c *IMAPClient) FetchAllSizes() *IMAPResponse
func (*IMAPClient) FetchAllSubjects ¶
func (c *IMAPClient) FetchAllSubjects() *IMAPResponse
func (*IMAPClient) FetchUID ¶
func (c *IMAPClient) FetchUID(ids, parts string) *IMAPResponse
func (*IMAPClient) GetMailboxInfo ¶
func (c *IMAPClient) GetMailboxInfo(mailboxName string) *IMAPResponse
func (*IMAPClient) GetMailboxStatus ¶
func (c *IMAPClient) GetMailboxStatus(mailboxName string) *IMAPResponse
func (*IMAPClient) ID ¶ added in v1.6.3
func (c *IMAPClient) ID(request string) *IMAPResponse
func (*IMAPClient) ListMailboxes ¶
func (c *IMAPClient) ListMailboxes() *IMAPResponse
func (*IMAPClient) Login ¶
func (c *IMAPClient) Login(account, password string) *IMAPResponse
func (*IMAPClient) Logout ¶
func (c *IMAPClient) Logout() *IMAPResponse
func (*IMAPClient) MarkAsDeleted ¶
func (c *IMAPClient) MarkAsDeleted(ids string) *IMAPResponse
func (*IMAPClient) MarkAsRead ¶
func (c *IMAPClient) MarkAsRead(ids string) *IMAPResponse
func (*IMAPClient) MarkAsStarred ¶
func (c *IMAPClient) MarkAsStarred(ids string) *IMAPResponse
func (*IMAPClient) MarkAsUndeleted ¶
func (c *IMAPClient) MarkAsUndeleted(ids string) *IMAPResponse
func (*IMAPClient) MarkAsUnread ¶
func (c *IMAPClient) MarkAsUnread(ids string) *IMAPResponse
func (*IMAPClient) MarkAsUnstarred ¶
func (c *IMAPClient) MarkAsUnstarred(ids string) *IMAPResponse
func (*IMAPClient) Move ¶
func (c *IMAPClient) Move(ids, newMailboxName string) *IMAPResponse
func (*IMAPClient) Noop ¶ added in v1.8.11
func (c *IMAPClient) Noop() *IMAPResponse
func (*IMAPClient) RemoveFlags ¶
func (c *IMAPClient) RemoveFlags(ids, flags string) *IMAPResponse
func (*IMAPClient) RenameMailbox ¶
func (c *IMAPClient) RenameMailbox(mailboxName, newMailboxName string) *IMAPResponse
func (*IMAPClient) Search ¶
func (c *IMAPClient) Search(query string) *IMAPResponse
func (*IMAPClient) Select ¶
func (c *IMAPClient) Select(mailboxName string) *IMAPResponse
func (*IMAPClient) SendCommand ¶
func (c *IMAPClient) SendCommand(command string) *IMAPResponse
func (*IMAPClient) SetFlags ¶
func (c *IMAPClient) SetFlags(ids, flags string) *IMAPResponse
func (*IMAPClient) StartIDLE ¶
func (c *IMAPClient) StartIDLE() *IMAPResponse
func (*IMAPClient) StopIDLE ¶
func (c *IMAPClient) StopIDLE()
type IMAPMailbox ¶
type IMAPMailbox struct {
// contains filtered or unexported fields
}
func (*IMAPMailbox) Check ¶
func (m *IMAPMailbox) Check() error
func (*IMAPMailbox) CopyMessages ¶
func (m *IMAPMailbox) CopyMessages(uid bool, seqset *imap.SeqSet, dest string) error
func (*IMAPMailbox) CreateMessage ¶
func (m *IMAPMailbox) CreateMessage(flags []string, date time.Time, body imap.Literal) error
func (*IMAPMailbox) Expunge ¶
func (m *IMAPMailbox) Expunge() error
func (*IMAPMailbox) Info ¶
func (m *IMAPMailbox) Info() (*imap.MailboxInfo, error)
func (*IMAPMailbox) ListMessages ¶
func (m *IMAPMailbox) ListMessages(uid bool, seqset *imap.SeqSet, items []imap.FetchItem, ch chan<- *imap.Message) error
func (*IMAPMailbox) Name ¶
func (m *IMAPMailbox) Name() string
func (*IMAPMailbox) SearchMessages ¶
func (m *IMAPMailbox) SearchMessages(uid bool, criteria *imap.SearchCriteria) ([]uint32, error)
func (*IMAPMailbox) SetSubscribed ¶
func (m *IMAPMailbox) SetSubscribed(subscribed bool) error
func (*IMAPMailbox) Status ¶
func (m *IMAPMailbox) Status(items []imap.StatusItem) (*imap.MailboxStatus, error)
func (*IMAPMailbox) UpdateMessagesFlags ¶
func (m *IMAPMailbox) UpdateMessagesFlags(uid bool, seqset *imap.SeqSet, operation imap.FlagsOp, flags []string) error
type IMAPResponse ¶
type IMAPResponse struct {
// contains filtered or unexported fields
}
func (*IMAPResponse) AssertError ¶
func (ir *IMAPResponse) AssertError(wantErrMsg string) *IMAPResponse
func (*IMAPResponse) AssertNotSections ¶
func (ir *IMAPResponse) AssertNotSections(unwantedRegexps ...string) *IMAPResponse
AssertNotSections is similar to AssertSections but is the opposite. It means it just tries to find all "regexps" in the response.
func (*IMAPResponse) AssertOK ¶
func (ir *IMAPResponse) AssertOK() *IMAPResponse
func (*IMAPResponse) AssertResult ¶ added in v1.7.0
func (ir *IMAPResponse) AssertResult(wantResult string) *IMAPResponse
func (*IMAPResponse) AssertSections ¶
func (ir *IMAPResponse) AssertSections(wantRegexps ...string) *IMAPResponse
AssertSections is similar to AssertSectionsInOrder but is not strict to the order. It means it just tries to find all "regexps" in the response.
func (*IMAPResponse) AssertSectionsCount ¶
func (ir *IMAPResponse) AssertSectionsCount(expectedCount int) *IMAPResponse
func (*IMAPResponse) AssertSectionsInOrder ¶
func (ir *IMAPResponse) AssertSectionsInOrder(wantRegexps ...string) *IMAPResponse
AssertSectionsInOrder checks sections against regular expression in exact order. First regexp checks first section, second the second and so on. If there is more responses (sections) than expected regexps, that's OK.
func (*IMAPResponse) HasSections ¶
func (ir *IMAPResponse) HasSections(wantRegexps ...string) bool
HasSections is the same as AssertSections but only returns bool (do not uses testingT).
func (*IMAPResponse) Sections ¶ added in v1.8.11
func (ir *IMAPResponse) Sections() []string
func (*IMAPResponse) WaitForNotSections ¶
func (ir *IMAPResponse) WaitForNotSections(timeout time.Duration, unwantedRegexps ...string) *IMAPResponse
WaitForNotSections is the opposite of WaitForSection: waits to not have the response.
func (*IMAPResponse) WaitForSections ¶
func (ir *IMAPResponse) WaitForSections(timeout time.Duration, wantRegexps ...string)
WaitForSections is the same as AssertSections but waits for `timeout` before giving up.
type IMAPServer ¶
type IMAPServer struct { Username string Password string Host string Port string // contains filtered or unexported fields }
func NewIMAPServer ¶
func NewIMAPServer(username, password, host, port string) *IMAPServer
func (*IMAPServer) AddMailbox ¶
func (s *IMAPServer) AddMailbox(mailboxName string)
func (*IMAPServer) AddMessage ¶
func (s *IMAPServer) AddMessage(mailboxName string, message *imap.Message)
func (*IMAPServer) Start ¶
func (s *IMAPServer) Start()
func (*IMAPServer) Stop ¶
func (s *IMAPServer) Stop()
type IMAPUser ¶
type IMAPUser struct {
// contains filtered or unexported fields
}
func (*IMAPUser) CreateMailbox ¶
func (*IMAPUser) DeleteMailbox ¶
func (*IMAPUser) GetMailbox ¶
func (u *IMAPUser) GetMailbox(name string) (imapbackend.Mailbox, error)
func (*IMAPUser) ListMailboxes ¶
func (u *IMAPUser) ListMailboxes(subscribed bool) ([]imapbackend.Mailbox, error)
func (*IMAPUser) RenameMailbox ¶
type SMTPClient ¶
type SMTPClient struct {
// contains filtered or unexported fields
}
func NewSMTPClient ¶
func NewSMTPClient(t TestingT, tag, smtpAddr string) *SMTPClient
func (*SMTPClient) Close ¶
func (c *SMTPClient) Close()
func (*SMTPClient) EML ¶
func (c *SMTPClient) EML(fileName, bcc string) *SMTPResponse
func (*SMTPClient) Login ¶
func (c *SMTPClient) Login(account, password string) *SMTPResponse
func (*SMTPClient) Logout ¶
func (c *SMTPClient) Logout() *SMTPResponse
func (*SMTPClient) SendCommands ¶
func (c *SMTPClient) SendCommands(commands ...string) *SMTPResponse
func (*SMTPClient) SendMail ¶
func (c *SMTPClient) SendMail(r io.Reader, bcc string) *SMTPResponse
type SMTPResponse ¶
type SMTPResponse struct {
// contains filtered or unexported fields
}
func (*SMTPResponse) AssertError ¶
func (sr *SMTPResponse) AssertError(wantErrMsg string) *SMTPResponse
func (*SMTPResponse) AssertOK ¶
func (sr *SMTPResponse) AssertOK() *SMTPResponse