mocks

package
v2.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2022 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

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

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

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

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

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

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 (u *IMAPUser) CreateMailbox(name string) error

func (*IMAPUser) DeleteMailbox

func (u *IMAPUser) DeleteMailbox(name string) error

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) Logout

func (u *IMAPUser) Logout() error

func (*IMAPUser) RenameMailbox

func (u *IMAPUser) RenameMailbox(existingName, newName string) error

func (*IMAPUser) Username

func (u *IMAPUser) Username() string

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

type TestingT

type TestingT interface {
	Errorf(string, ...interface{})
	FailNow()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL