inbox

package
v1.0.4-0...-325699b Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inbox

type Inbox struct {
	Name  string `json:"name"`
	Mails []Mail `json:"mails"`
	// contains filtered or unexported fields
}

Inbox represents a mail collection

func NewInbox

func NewInbox(name string) (*Inbox, error)

NewInbox creates a new mail inbox

func (*Inbox) Add

func (i *Inbox) Add(mail Mail)

Add appends a mail to mail list

func (*Inbox) Count

func (i *Inbox) Count() int

Count returns total number of mails available in inbox

func (*Inbox) Delete

func (i *Inbox) Delete(position int) error

Delete an email

func (*Inbox) Flush

func (i *Inbox) Flush() error

Flush empties an inbox

func (*Inbox) Get

func (i *Inbox) Get(offset int) *Mail

Get returns email at given offset

func (*Inbox) GetMails

func (i *Inbox) GetMails() []Mail

func (*Inbox) Parse

func (i *Inbox) Parse(position int) error

Parse retrieves all email datas

func (*Inbox) ParseInboxPages

func (i *Inbox) ParseInboxPages(limit int) error

ParseInboxPages parses inbox email in given page

func (*Inbox) Shrink

func (i *Inbox) Shrink(limit int)

Shrink reduces mails size to given value

type Mail

type Mail struct {
	ID     string     `json:"id"`
	Sender *Sender    `json:"sender,omitempty"`
	Title  string     `json:"title"`
	Date   *time.Time `json:"date,omitempty"`
	Body   string     `json:"body,omitempty"`
	IsSPAM bool       `json:"isSPAM"`
}

Mail is a message

type Sender

type Sender struct {
	Mail string `json:"mail,omitempty"`
	Name string `json:"name,omitempty"`
}

Sender defines a mail sender

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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