apiv1

package
v0.0.0-...-06e1c0a Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppInfo

func AppInfo(w http.ResponseWriter, r *http.Request)

AppInfo returns some basic details about the running app, and latest release.

func DeleteMessages

func DeleteMessages(w http.ResponseWriter, r *http.Request)

DeleteMessages (method: DELETE) deletes all messages matching IDS.

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 GetHeaders

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 GetMessages

func GetMessages(w http.ResponseWriter, r *http.Request)

GetMessages returns a paginated list of messages as JSON

func Search(w http.ResponseWriter, r *http.Request)

Search returns the latest messages as JSON

func SetReadStatus

func SetReadStatus(w http.ResponseWriter, r *http.Request)

SetReadStatus (method: PUT) will update the status to Read/Unread for all provided IDs If no IDs are provided then all messages are updated.

func SetTags

func SetTags(w http.ResponseWriter, r *http.Request)

SetTags (method: PUT) will set the tags for all provided IDs

func Thumbnail

func Thumbnail(w http.ResponseWriter, r *http.Request)

Thumbnail returns a thumbnail image for an attachment (images only)

Types

type Attachment

type Attachment = storage.Attachment

Attachment summary

type Message

type Message = storage.Message

Message data

type MessageSummary

type MessageSummary = storage.MessageSummary

MessageSummary - summary of a single message

type MessagesSummary

type MessagesSummary struct {
	// Total number of messages in mailbox
	Total int `json:"total"`

	// Total number of unread messages in mailbox
	Unread int `json:"unread"`

	// Number of results returned
	Count int `json:"count"`

	// 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

Jump to

Keyboard shortcuts

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