Documentation
¶
Overview ¶
Package apiv1 handles all the API responses
Package apiv1 provides the API v1 endpoints for Mailpit.
These structs are for the purpose of defining swagger HTTP parameters in go-swagger in order to generate a spec file. They are lowercased to avoid exporting them as public types.
Package apiv1 provides the API v1 endpoints for Mailpit.
These structs are for the purpose of defining swagger HTTP responses in go-swagger in order to generate a spec file. They are lowercased to avoid exporting them as public types.
Index ¶
- func AppInfo(w http.ResponseWriter, _ *http.Request)
- func DeleteMessages(w http.ResponseWriter, r *http.Request)
- func DeleteSearch(w http.ResponseWriter, r *http.Request)
- func DeleteTag(w http.ResponseWriter, r *http.Request)
- func DownloadAttachment(w http.ResponseWriter, r *http.Request)
- func DownloadRaw(w http.ResponseWriter, r *http.Request)
- func GetAllTags(w http.ResponseWriter, _ *http.Request)
- func GetChaos(w http.ResponseWriter, _ *http.Request)
- func GetHeaders(w http.ResponseWriter, r *http.Request)
- func GetMessage(w http.ResponseWriter, r *http.Request)
- func GetMessageHTML(w http.ResponseWriter, r *http.Request)
- func GetMessageText(w http.ResponseWriter, r *http.Request)
- func GetMessages(w http.ResponseWriter, r *http.Request)
- func GetOptions(w http.ResponseWriter, _ *http.Request)
- func HTMLCheck(w http.ResponseWriter, r *http.Request)
- func LinkCheck(w http.ResponseWriter, r *http.Request)
- func ReleaseMessage(w http.ResponseWriter, r *http.Request)
- func RenameTag(w http.ResponseWriter, r *http.Request)
- func Search(w http.ResponseWriter, r *http.Request)
- func SendMessageHandler(w http.ResponseWriter, r *http.Request)
- func SetChaos(w http.ResponseWriter, r *http.Request)
- func SetMessageTags(w http.ResponseWriter, r *http.Request)
- func SetReadStatus(w http.ResponseWriter, r *http.Request)
- func SpamAssassinCheck(w http.ResponseWriter, r *http.Request)
- func Thumbnail(w http.ResponseWriter, r *http.Request)
- func WebUIConfig(w http.ResponseWriter, _ *http.Request)
- type Attachment
- type Message
- type MessageSummary
- type MessagesSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppInfo ¶
func AppInfo(w http.ResponseWriter, _ *http.Request)
AppInfo returns some basic details about the running app including the latest release (unless disabled).
func DeleteMessages ¶
func DeleteMessages(w http.ResponseWriter, r *http.Request)
DeleteMessages (method: DELETE) deletes all messages matching IDS.
func DeleteSearch ¶ added in v1.9.0
func DeleteSearch(w http.ResponseWriter, r *http.Request)
DeleteSearch will delete all messages matching a search
func DeleteTag ¶ added in v1.19.0
func DeleteTag(w http.ResponseWriter, r *http.Request)
DeleteTag (method: DELETE) used to delete a tag
func DownloadAttachment ¶
func DownloadAttachment(w http.ResponseWriter, r *http.Request)
DownloadAttachment (method: GET) returns the attachment data
func DownloadRaw ¶
func DownloadRaw(w http.ResponseWriter, r *http.Request)
DownloadRaw (method: GET) returns the full email source as plain text
func GetAllTags ¶ added in v1.12.0
func GetAllTags(w http.ResponseWriter, _ *http.Request)
GetAllTags (method: GET) will get all tags currently in use
func GetChaos ¶ added in v1.22.0
func GetChaos(w http.ResponseWriter, _ *http.Request)
GetChaos returns the current Chaos triggers
func GetHeaders ¶ added in v1.5.0
func GetHeaders(w http.ResponseWriter, r *http.Request)
GetHeaders (method: GET) returns the message headers as JSON
func GetMessage ¶
func GetMessage(w http.ResponseWriter, r *http.Request)
GetMessage (method: GET) returns the Message as JSON
func GetMessageHTML ¶ added in v1.21.3
func GetMessageHTML(w http.ResponseWriter, r *http.Request)
GetMessageHTML (method: GET) returns a rendered version of a message's HTML part
func GetMessageText ¶ added in v1.21.3
func GetMessageText(w http.ResponseWriter, r *http.Request)
GetMessageText (method: GET) returns a message's text part
func GetMessages ¶
func GetMessages(w http.ResponseWriter, r *http.Request)
GetMessages returns a paginated list of messages as JSON
func GetOptions ¶ added in v1.6.9
func GetOptions(w http.ResponseWriter, _ *http.Request)
GetOptions returns a blank response
func HTMLCheck ¶ added in v1.8.0
func HTMLCheck(w http.ResponseWriter, r *http.Request)
HTMLCheck returns a summary of the HTML client support
func LinkCheck ¶ added in v1.8.2
func LinkCheck(w http.ResponseWriter, r *http.Request)
LinkCheck returns a summary of links in the email
func ReleaseMessage ¶ added in v1.6.0
func ReleaseMessage(w http.ResponseWriter, r *http.Request)
ReleaseMessage (method: POST) will release a message via a pre-configured external SMTP server.
func RenameTag ¶ added in v1.19.0
func RenameTag(w http.ResponseWriter, r *http.Request)
RenameTag (method: PUT) used to rename a tag
func Search ¶
func Search(w http.ResponseWriter, r *http.Request)
Search returns the latest messages as JSON
func SendMessageHandler ¶ added in v1.18.0
func SendMessageHandler(w http.ResponseWriter, r *http.Request)
SendMessageHandler handles HTTP requests to send a new message
func SetChaos ¶ added in v1.22.0
func SetChaos(w http.ResponseWriter, r *http.Request)
SetChaos sets the Chaos configuration.
func SetMessageTags ¶ added in v1.12.0
func SetMessageTags(w http.ResponseWriter, r *http.Request)
SetMessageTags (method: PUT) will set the tags for all provided IDs
func SetReadStatus ¶
func SetReadStatus(w http.ResponseWriter, r *http.Request)
SetReadStatus (method: PUT) will update the status to Read/Unread for all provided IDs.
func SpamAssassinCheck ¶ added in v1.13.0
func SpamAssassinCheck(w http.ResponseWriter, r *http.Request)
SpamAssassinCheck returns a summary of SpamAssassin results (if enabled)
func Thumbnail ¶
func Thumbnail(w http.ResponseWriter, r *http.Request)
Thumbnail returns a thumbnail image for an attachment (images only)
func WebUIConfig ¶ added in v1.6.0
func WebUIConfig(w http.ResponseWriter, _ *http.Request)
WebUIConfig returns configuration settings for the web UI.
Types ¶
type MessageSummary ¶
type MessageSummary = storage.MessageSummary
MessageSummary - summary of a single message
type MessagesSummary ¶
type MessagesSummary struct {
// Total number of messages in mailbox
Total uint64 `json:"total"`
// Total number of unread messages in mailbox
Unread uint64 `json:"unread"`
// Legacy - now undocumented in API specs but left for backwards compatibility.
// Removed from API documentation 2023-07-12
// swagger:ignore
Count uint64 `json:"count"`
// Total number of messages matching current query
MessagesCount uint64 `json:"messages_count"`
// Total number of unread messages matching current query
MessagesUnreadCount uint64 `json:"messages_unread"`
// Pagination offset
Start int `json:"start"`
// All current tags
Tags []string `json:"tags"`
// Messages summary
// in: body
Messages []storage.MessageSummary `json:"messages"`
}
MessagesSummary is a summary of a list of messages