apiv1

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 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. If no IDs are provided then all messages are deleted.

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 GetMessage

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

GetMessage (method: GET) returns the *data.Message as JSON

func GetMessages

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

GetMessages returns a paginated list of messages as JSON

func Headers

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

Headers (method: GET) returns the message headers as JSON

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

Search returns up to 200 of 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

func SetTags added in v1.2.8

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    int              `json:"total"`
	Unread   int              `json:"unread"`
	Count    int              `json:"count"`
	Start    int              `json:"start"`
	Tags     []string         `json:"tags"`
	Messages []MessageSummary `json:"messages"`
}

MessagesSummary - summary of a list of messages

Jump to

Keyboard shortcuts

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