Documentation
¶
Overview ¶
Package gohog is a client library to interact with and consume mailhog's api https://github.com/mailhog/MailHog mailhog is very useful when testing email integration
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
type Content struct {
Headers Headers `json:"headers"`
Body string `json:"body"`
Size int `json:"size"`
Mime Mime `json:"mime"`
}
Content of the email the Mime parts contain the content
type GoHog ¶
type GoHog struct {
// contains filtered or unexported fields
}
func NewGoHogClient ¶
NewGoHogClient creates a mailhog client
func (*GoHog) Delete ¶
Delete this will delete a email message from mailhog by id Example id: [email protected]
func (*GoHog) Message ¶
Message will return a single email message by id Example id: [email protected]
type Headers ¶
type Headers struct {
ContentId []string `json:"content-id"`
ContentDisposition []string `json:"content-disposition"`
ContentTransferEncoding []string `json:"content-transfer-encoding"`
ContentType []string `json:"content-type"`
Date []string `json:"date"`
From []string `json:"from"`
MimeVersion []string `json:"mime-version"`
MessageId []string `json:"message-id"`
Received []string `json:"received"`
ReturnPath []string `json:"return-path"`
Subject []string `json:"subject"`
To []string `json:"to"`
}
Headers metadata about the email message
type Message ¶
type Message struct {
Id string `json:"id"`
From Path `json:"from"`
To []Path `json:"to"`
Content Content `json:"content"`
Created time.Time `json:"created"`
Mime Mime `json:"mime"`
Raw Raw `json:"raw"`
}
Message is used to represent a single email message
func (*Message) FromAddress ¶
FromAddress convenience method to get the from email address
func (*Message) ToAddresses ¶
ToAddresses convenience method to get the to email addresses
type Messages ¶
type Messages struct {
Total int `json:"total"`
Count int `json:"count"`
Start int `json:"start"`
Items []Message `json:"items"`
}
Messages a struct the will contain a list of messages used for search and messages endpoint
type Mime ¶
type Mime struct {
Parts []Content
}
Mime email content parts, can be text or rich content