Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Name for test imap
Name = "imap"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶ added in v1.2.0
type AuthConfig struct { WithTLS bool `json:"withtls,omitempty" yaml:"withtls,omitempty"` Host string `json:"host,omitempty" yaml:"host,omitempty"` Port string `json:"port,omitempty" yaml:"port,omitempty"` User string `json:"user,omitempty" yaml:"user,omitempty"` Password string `json:"password,omitempty" yaml:"password,omitempty"` }
type Command ¶ added in v1.2.0
type Command struct { // Search defines the search criteria to retrieve a mail. Some commands need to act upon a mail retrieved through Search. Search SearchCriteria `json:"search" yaml:"search"` // Name defines an IMAP command to execute. Name CommandName `json:"name" yaml:"name"` // Args defines the arguments to the command. Arguments associated to the command are listed in the README file Args map[string]any `json:"args" yaml:"args"` }
Command represents a command that can be performed to messages or mailboxes.
type CommandName ¶ added in v1.2.0
type CommandName string
const ( // CommandAppend creates a new message at the end of a specified mailbox. CommandAppend CommandName = "append" // CommandCreate creates a new mailbox. CommandCreate CommandName = "create" // CommandClear permanently removes all messages from given mailboxes. CommandClear CommandName = "clear" // CommandDelete permanently removes a message retrieved through Search field CommandDelete CommandName = "delete" // CommandFetch retrieves a mail through Search field (no args) CommandFetch CommandName = "fetch" // CommandFlag adds, removes or sets flags to a message retrieved through Search field CommandFlag CommandName = "flag" // CommandMove moves a message retrieved through Search field from one mailbox to another. CommandMove CommandName = "move" )
type CommandResult ¶ added in v1.2.0
type CommandResult struct { // Search represents the result of the Command's search field Search Mail `json:"search,omitempty" yaml:"search,omitempty"` // Mail represents the state of the searched mail after the command was executed Mail Mail `json:"mail,omitempty" yaml:"mail,omitempty"` Err string `json:"err,omitempty" yaml:"err,omitempty"` TimeSeconds float64 `json:"timeseconds,omitempty" yaml:"timeseconds,omitempty"` }
CommandResult contains the results of a command with the states of the mail before and after the command.
type Executor ¶
type Executor struct { Auth AuthConfig `json:"auth" yaml:"auth"` Commands []Command `json:"commands,omitempty" yaml:"commands,omitempty"` }
Executor represents a Test Executor
func (Executor) GetDefaultAssertions ¶
func (Executor) GetDefaultAssertions() *venom.StepAssertions
GetDefaultAssertions return default assertions for type imap
func (Executor) ZeroValueResult ¶ added in v0.17.0
func (Executor) ZeroValueResult() interface{}
ZeroValueResult return an empty implementation of this executor result
type Mail ¶
type Mail struct { UID uint32 `json:"uid,omitempty" yaml:"uid,omitempty"` From string `json:"from,omitempty" yaml:"from,omitempty"` To string `json:"to,omitempty" yaml:"to,omitempty"` Subject string `json:"subject,omitempty" yaml:"subject,omitempty"` Body string `json:"body,omitempty" yaml:"body,omitempty"` Flags []string `json:"flags,omitempty" yaml:"flags,omitempty"` }
type Result ¶
type Result struct {
Commands []CommandResult `json:"commands,omitempty" yaml:"commands,omitempty"`
}
Result represents a step result. It contains the results of every command that was executed
type SearchCriteria ¶ added in v1.2.0
type SearchCriteria struct { Mailbox string `json:"mailbox,omitempty" yaml:"mailbox,omitempty"` UID uint32 `json:"uid,omitempty" yaml:"uid,omitempty"` From string `json:"from,omitempty" yaml:"from,omitempty"` To string `json:"to,omitempty" yaml:"to,omitempty"` Subject string `json:"subject,omitempty" yaml:"subject,omitempty"` Body string `json:"body,omitempty" yaml:"body,omitempty"` }
SearchCriteria represents the search criteria to fetch mails through FETCH command (https://www.rfc-editor.org/rfc/rfc3501#section-6.4.5)
Click to show internal directories.
Click to hide internal directories.