mbox

package
v0.0.0-...-f917c6c Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressJSON

type AddressJSON struct {
	Name    string
	Address string
}

AddressJSON represents a single mail address for generating JSON.

type BodyJSON

type BodyJSON struct {
	Class string
	Data  []string
}

BodyJSON represents a parsed mail body for generating JSON.

type Message

type Message struct {
	MessageId string
	InReplyTo string
	From      *mail.Address
	To        []*mail.Address
	Cc        []*mail.Address
	Subject   string
	Date      time.Time
	Body      []string
	Exist     bool
}

Message represents a parsed mail message.

func Read

func Read(data []byte) ([]*Message, error)

Read messages from mbox data.

type MessageJSON

type MessageJSON struct {
	MessageId string
	InReplyTo string
	From      *AddressJSON
	To        []*AddressJSON
	Cc        []*AddressJSON
	Subject   string
	Date      string
	Body      []*BodyJSON
	Exist     bool
}

MessageJSON represents a parsed message for generating JSON.

type Thread

type Thread struct {
	Name string
	Node *ThreadNode
}

Message thread

func Create

func Create(name string, messages []*Message) (*Thread, error)

Create a thread from messages.

func (*Thread) ParseHTML

func (t *Thread) ParseHTML(css, js string) []string

ParseHTML parses the thread for generating HTML.

func (*Thread) ParseJSON

func (t *Thread) ParseJSON() ([]byte, error)

ParseJSON parses the thread for generating JSON.

func (*Thread) ParsePatch

func (t *Thread) ParsePatch() ([][]string, error)

ParseJSON parses the thread for generating patches.

type ThreadJSON

type ThreadJSON struct {
	Name string
	Node *ThreadNodeJSON
}

Message thread for generating JSON.

type ThreadNode

type ThreadNode struct {
	Mesg  *Message
	Child []*ThreadNode
}

Message thread node contains a message and its children.

type ThreadNodeJSON

type ThreadNodeJSON struct {
	Mesg  *MessageJSON
	Child []*ThreadNodeJSON
}

Message thread node for generating JSON.

Jump to

Keyboard shortcuts

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