testutil

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MailpitSMTPPort = "1025"
	MailpitUIPort   = "8025"
	MailpitImage    = "axllent/mailpit:latest"
	ContainerName   = "mail_test_mailpit"
)

Variables

This section is empty.

Functions

func CheckDockerAvailable

func CheckDockerAvailable(t *testing.T)

CheckDockerAvailable verifies if Docker is available

func ClearMailpitMessages

func ClearMailpitMessages(t *testing.T)

ClearMailpitMessages clears all messages from Mailpit

func SetupMailpit

func SetupMailpit(t *testing.T) func()

SetupMailpit starts a Mailpit container for testing

Types

type EmailAddress

type EmailAddress struct {
	Name    string `json:"Name"`
	Address string `json:"Address"`
}

type MailpitMessage

type MailpitMessage struct {
	ID          string         `json:"ID"`
	MessageID   string         `json:"MessageID"`
	Read        bool           `json:"Read"`
	From        EmailAddress   `json:"From"`
	To          []EmailAddress `json:"To"`
	Subject     string         `json:"Subject"`
	Attachments int            `json:"Attachments"`
	Snippet     string         `json:"Snippet"`
}

func GetMailpitMessages

func GetMailpitMessages(t *testing.T) []MailpitMessage

GetMailpitMessages retrieves messages from Mailpit

Jump to

Keyboard shortcuts

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