koushinbase

package
v0.0.0-...-4cf5ad6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrViewUnsupported = fmt.Errorf("cannot generate message view: unsupported part")

ErrViewUnsupported is returned by Viewer.ViewMessagePart when the message part isn't supported.

Functions

func RegisterViewer

func RegisterViewer(viewer Viewer)

RegisterViewer registers a message part viewer.

Types

type Attachment

type Attachment interface {
	MIMEType() string
	Filename() string
	Open() (io.ReadCloser, error)
}

type ComposeRenderData

type ComposeRenderData struct {
	koushin.BaseRenderData
	Message *OutgoingMessage
}

type IMAPMessage

type IMAPMessage struct {
	*imap.Message

	Mailbox string
}

func (*IMAPMessage) Attachments

func (msg *IMAPMessage) Attachments() []IMAPPartNode

func (*IMAPMessage) HasFlag

func (msg *IMAPMessage) HasFlag(flag string) bool

func (*IMAPMessage) PartByID

func (msg *IMAPMessage) PartByID(id string) *IMAPPartNode

func (*IMAPMessage) PartByPath

func (msg *IMAPMessage) PartByPath(path []int) *IMAPPartNode

func (*IMAPMessage) PartTree

func (msg *IMAPMessage) PartTree() *IMAPPartNode

func (*IMAPMessage) TextPartName

func (msg *IMAPMessage) TextPartName() string

func (*IMAPMessage) URL

func (msg *IMAPMessage) URL() *url.URL

type IMAPPartNode

type IMAPPartNode struct {
	Path     []int
	MIMEType string
	Filename string
	Children []IMAPPartNode
	Message  *IMAPMessage
}

func (IMAPPartNode) IsText

func (node IMAPPartNode) IsText() bool

func (IMAPPartNode) PathString

func (node IMAPPartNode) PathString() string

func (IMAPPartNode) String

func (node IMAPPartNode) String() string

func (IMAPPartNode) URL

func (node IMAPPartNode) URL(raw bool) *url.URL

type MailboxInfo

type MailboxInfo struct {
	*imap.MailboxInfo
}

func (*MailboxInfo) URL

func (mbox *MailboxInfo) URL() *url.URL

type MailboxRenderData

type MailboxRenderData struct {
	koushin.BaseRenderData
	Mailbox            *MailboxStatus
	Mailboxes          []MailboxInfo
	Messages           []IMAPMessage
	PrevPage, NextPage int
	Query              string
}

type MailboxStatus

type MailboxStatus struct {
	*imap.MailboxStatus
}

func (*MailboxStatus) URL

func (mbox *MailboxStatus) URL() *url.URL

type MessageRenderData

type MessageRenderData struct {
	koushin.BaseRenderData
	Mailboxes   []MailboxInfo
	Mailbox     *MailboxStatus
	Message     *IMAPMessage
	Part        *IMAPPartNode
	View        interface{}
	MailboxPage int
	Flags       map[string]bool
}

type OutgoingMessage

type OutgoingMessage struct {
	From        string
	To          []string
	Subject     string
	InReplyTo   string
	Text        string
	Attachments []Attachment
}

func (*OutgoingMessage) ToString

func (msg *OutgoingMessage) ToString() string

func (*OutgoingMessage) WriteTo

func (msg *OutgoingMessage) WriteTo(w io.Writer) error

type Settings

type Settings struct {
	MessagesPerPage int
}

type SettingsRenderData

type SettingsRenderData struct {
	koushin.BaseRenderData
	Settings *Settings
}

type Viewer

type Viewer interface {
	// ViewMessagePart renders a message part. The returned value is displayed
	// in a template. ErrViewUnsupported is returned if the message part isn't
	// supported.
	ViewMessagePart(*koushin.Context, *IMAPMessage, *message.Entity) (interface{}, error)
}

Viewer is a message part viewer.

Jump to

Keyboard shortcuts

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