models

package
v0.0.0-...-9ae858a Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DATE_SQLITE_FORMAT = "2006-01-02 15:04:05.999999999Z07:00"

Variables

This section is empty.

Functions

This section is empty.

Types

type BodyPart

type BodyPart struct {
	Path        BodyPath `json:"path"`
	MIMEType    string   `json:"mimetype"`
	MIMESubType string   `json:"mimesubtype"`
}

func BodyPartsFromImap

func BodyPartsFromImap(bs *imap.BodyStructure) []*BodyPart

func (*BodyPart) Depth

func (bp *BodyPart) Depth() int

func (*BodyPart) FindMatch

func (bp *BodyPart) FindMatch(filters config.Filters) string

func (*BodyPart) StyledContent

func (bp *BodyPart) StyledContent() []*widgets.ContentWithStyle

type BodyPath

type BodyPath string

func BodyPathFromMessagePath

func BodyPathFromMessagePath(p []int) BodyPath

func (BodyPath) ToMessagePath

func (bp BodyPath) ToMessagePath() ([]int, error)

type DateFromStr

type DateFromStr struct {
	T time.Time
}

func (*DateFromStr) Scan

func (d *DateFromStr) Scan(src interface{}) error

type Mail

type Mail struct {
	Id        int
	Uid       uint32
	Threadid  int
	Subject   string
	Flags     []string
	MessageId string
	Mailbox   string
	InReplyTo string
	Parts     []*BodyPart

	Date   time.Time
	Header *mail.Header
	// contains filtered or unexported fields
}

func AllThreadMails

func AllThreadMails(r ndb.Queryer, rootMailId int) ([]*Mail, error)

given the id of a mail this function returns all of its children in its thread with specific depth for each

func AllThreadsRoot

func AllThreadsRoot(r ndb.Queryer, accname string) ([]*Mail, error)

func FetchMails

func FetchMails(r ndb.Queryer, mailbox, accname string, lastseenuid uint32) ([]*Mail, error)

func (*Mail) Delete

func (m *Mail) Delete(r ndb.Execer) error

func (*Mail) Depth

func (m *Mail) Depth() int

func (*Mail) FetchRoot

func (m *Mail) FetchRoot(r ndb.Queryer) (*Mail, error)

fetch thread root

func (*Mail) FindFirstNonMultipart

func (m *Mail) FindFirstNonMultipart() *BodyPart

func (*Mail) FindPlaintext

func (m *Mail) FindPlaintext() *BodyPart

func (*Mail) InsertInto

func (m *Mail) InsertInto(r ndb.Execer, mailbox, accname string) error

func (*Mail) IsUnread

func (m *Mail) IsUnread() bool

func (*Mail) MarkAsRead

func (m *Mail) MarkAsRead()

func (*Mail) SaveFlags

func (m *Mail) SaveFlags(r ndb.Execer) error

func (*Mail) StyledContent

func (m *Mail) StyledContent() []*widgets.ContentWithStyle

func (*Mail) UpdateFlags

func (m *Mail) UpdateFlags(r ndb.Execer, flags []string) error

func (*Mail) UpdateThreadid

func (m *Mail) UpdateThreadid(tx *sql.Tx) error

func (*Mail) UpdateThreadidOnChild

func (m *Mail) UpdateThreadidOnChild(tx *sql.Tx, threadid int) error

suppose to be called on root of thread

type Mailbox

type Mailbox struct {
	Name        string
	Parent      string
	ShortName   string
	Count       uint32
	Unseen      uint32
	ReadOnly    bool
	LastSeenUid uint32
	// contains filtered or unexported fields
}

func AllMailboxes

func AllMailboxes(r ndb.Queryer, accname string) ([]*Mailbox, error)

func GetMailbox

func GetMailbox(r ndb.Queryer, mboxname, accname string) (*Mailbox, error)

func (*Mailbox) Depth

func (m *Mailbox) Depth() int

func (*Mailbox) InsertInto

func (m *Mailbox) InsertInto(r ndb.Execer, accname string) error

func (*Mailbox) StyledContent

func (m *Mailbox) StyledContent() []*widgets.ContentWithStyle

func (*Mailbox) UpdateLastUid

func (m *Mailbox) UpdateLastUid(r ndb.Execer, accname string) error

type Thread

type Thread struct {
	Id        int
	RootId    int
	Subject   string
	Date      time.Time
	Count     int
	SeenCount int
}

XXX rename to ThreadInfo?

func AllThreads

func AllThreads(r ndb.Queryer, mailbox, accname string) ([]*Thread, error)

func (*Thread) HasUnread

func (t *Thread) HasUnread() bool

func (*Thread) MarkOneAsRead

func (t *Thread) MarkOneAsRead()

func (*Thread) StyledContent

func (t *Thread) StyledContent() []*widgets.ContentWithStyle

type ThreadCounter

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

func FetchThreadCounter

func FetchThreadCounter(r ndb.Queryer) (ThreadCounter, error)

func (*ThreadCounter) Next

func (t *ThreadCounter) Next() int

func (*ThreadCounter) UpdateThreadCounter

func (t *ThreadCounter) UpdateThreadCounter(r ndb.Execer) error

Jump to

Keyboard shortcuts

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