mailwatcher

package module
v0.0.0-...-533a456 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2014 License: MIT Imports: 4 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mail

type Mail struct {
	User    string
	Pass    string
	Address string
	Mailbox string
	// contains filtered or unexported fields
}

func New

func New(user, pwd, addr string) (*Mail, error)

Initialize new Mail

func (*Mail) Fetch

func (m *Mail) Fetch(filter string) (err error)

Fetch the latest email using the field Mailbox and an argument for a filter (e.g. "UNSEEN") to be searched

func (*Mail) Messages

func (m *Mail) Messages() (msg []Message)

func (*Mail) Start

func (m *Mail) Start() (*Mail, error)

Runs dial and login

func (*Mail) Watch

func (m *Mail) Watch(incoming chan Message, timer time.Duration)

Blocks by looping with an specific interval and passes new incoming emails (inbox/unseen)

func (*Mail) WatchFunc

func (m *Mail) WatchFunc(timer time.Duration, fn func(Message))

Same as Watch func, but using a callback instead of passing to a channel

type Message

type Message struct {
	Header mail.Header
	Body   []byte
	UID    uint32
}

Response with header, uid and body of the mail

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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