mstore

package
v0.0.0-...-4b6167c Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIMAPInvalidConfig = errors.New("invalid imap configuration")
	ErrIMAPConnFailure   = errors.New("could not connect with imap")
	ErrIMAPNotConnected  = errors.New("unable to perform, not connected to imap")
	ErrIMAPServerProblem = errors.New("imap server was unable to perform operation")
)
View Source
var (
	ErrInvalidFolderSet  = errors.New("invalid folder set")
	ErrInvalidFolderName = errors.New("invalid folder name")
)
View Source
var (
	ErrFolderDoesNotExist  = errors.New("folder does not exist")
	ErrNoFolderSelected    = errors.New("no folder selected")
	ErrInvalidUid          = errors.New("invalid uid")
	ErrMessageDoesNotExist = errors.New("message does not exist")
	ErrInvalidMessage      = errors.New("message is invalid")
)

Functions

This section is empty.

Types

type IMAP

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

func NewIMAP

func NewIMAP(config *IMAPConfig) *IMAP

func (*IMAP) Add

func (im *IMAP) Add(folder, subject, body string) error

func (*IMAP) Close

func (im *IMAP) Close()

func (*IMAP) Connect

func (im *IMAP) Connect() error

func (*IMAP) Folders

func (im *IMAP) Folders() ([]string, error)

func (*IMAP) Messages

func (im *IMAP) Messages(folder string) ([]*Message, error)

func (*IMAP) Remove

func (im *IMAP) Remove(msg *Message) error

type IMAPBody

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

func NewIMAPBody

func NewIMAPBody(msg string) *IMAPBody

func (*IMAPBody) Len

func (b *IMAPBody) Len() int

func (*IMAPBody) Read

func (b *IMAPBody) Read(p []byte) (int, error)

type IMAPConfig

type IMAPConfig struct {
	IMAPURL      string
	IMAPUsername string
	IMAPPassword string
}

func (*IMAPConfig) Valid

func (esc *IMAPConfig) Valid() bool

type MStorer

type MStorer interface {
	Folders() ([]string, error)
	Messages(folder string) ([]*Message, error)
	Add(folder, subject, body string) error
	Remove(msg *Message) error
}

type Memory

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

func NewMemory

func NewMemory(folders []string) (*Memory, error)

func (*Memory) Add

func (mem *Memory) Add(folder, subject, body string) error

func (*Memory) Folders

func (mem *Memory) Folders() ([]string, error)

func (*Memory) Messages

func (mem *Memory) Messages(folder string) ([]*Message, error)

func (*Memory) Remove

func (mem *Memory) Remove(msg *Message) error

type Message

type Message struct {
	Uid     uint32
	Folder  string
	Subject string
	Body    string
}

func (*Message) Valid

func (m *Message) Valid() bool

Jump to

Keyboard shortcuts

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