notmuch

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

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

Go to latest
Published: Aug 7, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Name    string `json:"name"`
	Address string `json:"address"`
	Count   int    `json:"count"`
	// contains filtered or unexported fields
}

func (*Address) String

func (a *Address) String() string

type Addresses

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

Addresses is an iterator over results from a `notmuch address` command

func (*Addresses) Address

func (a *Addresses) Address() *Address

func (*Addresses) Err

func (a *Addresses) Err() error

func (*Addresses) Next

func (a *Addresses) Next() bool

Next returns true as long as there is another address to read. The current address is available via the Address method. Any errors will be available via Err()

type Count

type Count struct {
	Value   int
	UUID    string
	LastMod int64
}

func (*Count) String

func (c *Count) String() string

type Counts

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

func (*Counts) Count

func (c *Counts) Count() *Count

func (*Counts) Err

func (c *Counts) Err() error

func (*Counts) Next

func (c *Counts) Next() bool

Next returns true as long as there is another count to read. The current count is available via the Count method. Any errors will be available via Err()

type Files

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

func (*Files) Err

func (f *Files) Err() error

func (*Files) File

func (f *Files) File() string

func (*Files) Next

func (f *Files) Next() bool

Next returns true as long as there is another file to read. The current file is available via the File method. Any errors will be available via Err()

type MessageIDs

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

func (*MessageIDs) Err

func (m *MessageIDs) Err() error

func (*MessageIDs) MessageID

func (m *MessageIDs) MessageID() string

func (*MessageIDs) Next

func (m *MessageIDs) Next() bool

Next returns true as long as there is another messageID to read. The current messageID is available via the MessageID method. Any errors will be available via Err()

type Notmuch

type Notmuch struct {
	Config   string
	Database string
	Profile  string
	UUID     string
}

func (*Notmuch) Address

func (nm *Notmuch) Address(ctx context.Context, args ...string) (*Addresses, error)

Address performs a `notmuch address` command. The return value is an iterator over the result. If the iterator is not read completely, the context must be cancelled in order for the command to be properly cleaned up

func (*Notmuch) Count

func (nm *Notmuch) Count(ctx context.Context, args ...string) (*Count, error)

Count performs a `notmuch count` command. For batch counts, use CountBatch

func (*Notmuch) CountBatch

func (nm *Notmuch) CountBatch(ctx context.Context, r io.Reader) (*Counts, error)

CountBatch performs a `notmuch count --batch` command. The return value is an iterator over the result. If the iterator is not read completely, the context must be cancelled in order for the command to be properly cleaned up

func (*Notmuch) New

func (nm *Notmuch) New(ctx context.Context, wc io.WriteCloser, args ...string) error

New performs a `notmuch new` command. The passed writer is attached to the stdout of the command. This can be nil and the output will be discarded

func (*Notmuch) Restore

func (nm *Notmuch) Restore(ctx context.Context, r io.Reader, wc io.WriteCloser, args ...string) error

Restore performs a `notmuch restore` command, reading from r. This is a blocking call. An optional WriteCloser can be supplied and will be attached to the commands stdout

func (*Notmuch) Search

func (nm *Notmuch) Search(ctx context.Context, args ...string) (*Summaries, error)

Search performs a `notmuch search --output=summary` command. This is equivalent to using `notmuch search`

func (*Notmuch) SearchFiles

func (nm *Notmuch) SearchFiles(ctx context.Context, args ...string) (*Files, error)

SearchFiles performs a `notmuch search --output=files` command

func (*Notmuch) SearchMessageIDs

func (nm *Notmuch) SearchMessageIDs(ctx context.Context, args ...string) (*MessageIDs, error)

SearchMessageIDs performs a `notmuch search --output=messages` command

func (*Notmuch) SearchTags

func (nm *Notmuch) SearchTags(ctx context.Context, args ...string) (*Tags, error)

SearchTags performs a `notmuch search --output=tags` command

func (*Notmuch) SearchThreadIDs

func (nm *Notmuch) SearchThreadIDs(ctx context.Context, args ...string) (*ThreadIDs, error)

SearchThreadIDs performs a `notmuch search --output=threads` command

func (*Notmuch) Show

func (nm *Notmuch) Show(ctx context.Context, args ...string) (*Threads, error)

func (*Notmuch) Tag

func (nm *Notmuch) Tag(ctx context.Context, args ...string) (io.Reader, error)

Performs a 'notmuch tag' command. The io.Reader will be attached to the command's output

func (*Notmuch) TagBatch

func (nm *Notmuch) TagBatch(ctx context.Context, r io.Reader, wc io.WriteCloser, args ...string) error

TagBatch performs a `notmuch tag --batch` command, reading from r. This is a blocking call. An optional WriteCloser can be supplied and will be attached to the commands stdout

type Part

type Part struct {
	ID          int    `json:"id"`
	ContentType string `json:"content-type"`
	Content     string `json:"content"`
}

type Summaries

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

Summaries is an iterator over results from a `notmuch search` command

func (*Summaries) Err

func (s *Summaries) Err() error

func (*Summaries) Next

func (s *Summaries) Next() bool

Next returns true as long as there is another summary to read. The current summary is available via the Summary method. Any errors will be available via Err()

func (*Summaries) Summary

func (s *Summaries) Summary() *Summary

type Summary

type Summary struct {
	Thread       string   `json:"thread"`
	Timestamp    int64    `json:"timestamp"`
	DateRelative string   `json:"date_relative"`
	Matched      int      `json:"matched"`
	Total        int      `json:"total"`
	Authors      string   `json:"authors"`
	Subject      string   `json:"subject"`
	Query        []string `json:"query"`
	Tags         []string `json:"tags"`
}

type Tags

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

func (*Tags) Err

func (t *Tags) Err() error

func (*Tags) Next

func (t *Tags) Next() bool

Next returns true as long as there is another tag to read. The current tag is available via the Tag method. Any errors will be available via Err()

func (*Tags) Tag

func (t *Tags) Tag() string

type Thread

type Thread struct {
	ID           string   `json:"id"`
	Match        bool     `json:"match"`
	Excluded     bool     `json:"excluded"`
	Filename     []string `json:"filename"`
	Timestamp    int64    `json:"timestamp"`
	DateRelative string   `json:"date_relative"`
	Tags         []string `json:"tags"`
	Duplicate    int      `json:"duplicate"`
	Body         []*Part  `json:"body"`
}

type ThreadIDs

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

func (*ThreadIDs) Err

func (t *ThreadIDs) Err() error

func (*ThreadIDs) Next

func (t *ThreadIDs) Next() bool

Next returns true as long as there is another threadID to read. The current threadID is available via the ThreadID method. Any errors will be available via Err()

func (*ThreadIDs) ThreadID

func (t *ThreadIDs) ThreadID() string

type Threads

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

Threads is an iterator over results from a `notmuch show` command

func (*Threads) Next

func (t *Threads) Next() bool

Next returns true as long as there is another thread to read. The current thread is available via the Thread method. Any errors will be available via Err()

Directories

Path Synopsis
cmd
lib
new

Jump to

Keyboard shortcuts

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