m2dir

package module
v0.0.0-...-e1591e6 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 17 Imported by: 0

README

go-m2dir

A (WIP) Go library for m2dir.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotM2Store = errors.New("not a valid m2store")
View Source
var (
	ErrNotM2dir = errors.New("not a valid m2dir")
)

Functions

This section is empty.

Types

type Flag

type Flag string

Flag is a message flag.

const (
	// The user has replied to this message.
	FlagAnswered Flag = "$answered"
	// The user has resent/forwarded/bounced this message to someone else.
	FlagForwarded Flag = "$Forwarded"
	// The user has viewed this message, though perhaps he didn't read all the
	// way through it.
	FlagSeen Flag = "$seen"
	// The user has moved this message to the trash; the trash will be emptied
	// by a later user action.
	FlagDeleted Flag = "$Deleted"
	// The user considers this message a draft; toggled at user discretion.
	FlagDraft Flag = "$draft"
	// User-defined flag; toggled at user discretion.
	FlagFlagged Flag = "$flagged"
)

type Folder

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

func (*Folder) Dir

func (f *Folder) Dir() *M2dir

func (*Folder) Folders

func (f *Folder) Folders() ([]*Folder, error)

func (*Folder) FullName

func (f *Folder) FullName() string

func (*Folder) Name

func (f *Folder) Name() string

type ID

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

func NewID

func NewID(msg []byte) (*ID, error)

func ParseID

func ParseID(value string) (*ID, error)

func (*ID) Checksum

func (i *ID) Checksum() string

func (*ID) Nonce

func (i *ID) Nonce() string

func (*ID) String

func (i *ID) String() string

type InvalidID

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

func (InvalidID) Error

func (i InvalidID) Error() string

type M2dir

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

func InitM2dir

func InitM2dir(path string) (*M2dir, error)

func OpenM2dir

func OpenM2dir(path string) (*M2dir, error)

func (*M2dir) MessageByID

func (m *M2dir) MessageByID(id string) (*Message, error)

func (*M2dir) Messages

func (m *M2dir) Messages() ([]*Message, error)

func (*M2dir) Path

func (m *M2dir) Path() string

func (*M2dir) Store

func (m *M2dir) Store(msg io.Reader, flags []Flag) (*Message, error)

type M2store

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

func InitM2store

func InitM2store(path string) (*M2store, error)

func OpenM2store

func OpenM2store(path string) (*M2store, error)

func (*M2store) AllFolders

func (m *M2store) AllFolders() ([]*Folder, error)

func (*M2store) Folders

func (m *M2store) Folders() ([]*Folder, error)

func (*M2store) Root

func (m *M2store) Root() string

type Message

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

Message represents a message in a M2dir.

func (*Message) CopyTo

func (m *Message) CopyTo(dst *M2dir) (*Message, error)

func (*Message) Dir

func (m *Message) Dir() *M2dir

func (*Message) Flags

func (m *Message) Flags() ([]Flag, error)

func (*Message) ID

func (m *Message) ID() *ID

func (*Message) Path

func (m *Message) Path() string

func (*Message) Remove

func (m *Message) Remove() error

func (*Message) SetFlags

func (m *Message) SetFlags(flags []Flag) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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