file

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 5, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg config.Storage) (storage.Store, error)

New creates a new DataStore object using the specified path

Types

type Message

type Message struct {

	// Stored in GOB
	Fid      string
	Fdate    time.Time
	Ffrom    *mail.Address
	Fto      []*mail.Address
	Fsubject string
	Fsize    int64
	Fseen    bool
	// contains filtered or unexported fields
}

Message implements Message and contains a little bit of data about a particular email message, and methods to retrieve the rest of it from disk.

func (*Message) Date

func (m *Message) Date() time.Time

Date returns the date/time this Message was received by Inbucket

func (*Message) From

func (m *Message) From() *mail.Address

From returns the value of the Message From header

func (*Message) ID

func (m *Message) ID() string

ID gets the ID of the Message

func (*Message) Mailbox

func (m *Message) Mailbox() string

Mailbox returns the name of the mailbox this message resides in.

func (*Message) Seen

func (m *Message) Seen() bool

Seen returns the seen flag value.

func (*Message) Size

func (m *Message) Size() int64

Size returns the size of the Message on disk in bytes

func (*Message) Source

func (m *Message) Source() (reader io.ReadCloser, err error)

Source opens the .raw portion of a Message as an io.ReadCloser

func (*Message) Subject

func (m *Message) Subject() string

Subject returns the value of the Message Subject header

func (*Message) To

func (m *Message) To() []*mail.Address

To returns the value of the Message To header

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements DataStore aand is the root of the mail storage hiearchy. It provides access to Mailbox objects

func (*Store) AddMessage

func (fs *Store) AddMessage(m storage.Message) (id string, err error)

AddMessage adds a message to the specified mailbox.

func (*Store) GetMessage

func (fs *Store) GetMessage(mailbox, id string) (storage.Message, error)

GetMessage returns the messages in the named mailbox, or an error.

func (*Store) GetMessages

func (fs *Store) GetMessages(mailbox string) ([]storage.Message, error)

GetMessages returns the messages in the named mailbox, or an error.

func (*Store) MarkSeen

func (fs *Store) MarkSeen(mailbox, id string) error

MarkSeen flags the message as having been read.

func (*Store) PurgeMessages

func (fs *Store) PurgeMessages(mailbox string) error

PurgeMessages deletes all messages in the named mailbox, or returns an error.

func (*Store) RemoveMessage

func (fs *Store) RemoveMessage(mailbox, id string) error

RemoveMessage deletes a message by ID from the specified mailbox.

func (*Store) VisitMailboxes

func (fs *Store) VisitMailboxes(f func([]storage.Message) (cont bool)) error

VisitMailboxes accepts a function that will be called with the messages in each mailbox while it continues to return true.

Jump to

Keyboard shortcuts

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