daemonclient

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaemonProcAttr

func DaemonProcAttr() *syscall.SysProcAttr

DaemonProcAttr returns SysProcAttr for detaching the daemon process.

Types

type Client

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

Client connects to the matcha daemon over a Unix domain socket.

func Dial

func Dial() (*Client, error)

Dial connects to the daemon socket.

func (*Client) Call

func (c *Client) Call(method string, params interface{}, result interface{}) error

Call makes a synchronous RPC call to the daemon.

func (*Client) Close

func (c *Client) Close() error

Close closes the connection to the daemon.

func (*Client) Events

func (c *Client) Events() <-chan *daemonrpc.Event

Events returns the channel that receives push events from the daemon.

func (*Client) Ping

func (c *Client) Ping() error

Ping checks if the daemon is responsive.

func (*Client) Status

func (c *Client) Status() (*daemonrpc.StatusResult, error)

Status returns daemon status info.

type Service

type Service interface {
	FetchEmails(accountID, folder string, limit, offset uint32) ([]backend.Email, error)
	FetchEmailBody(accountID, folder string, uid uint32) (string, []backend.Attachment, error)
	DeleteEmails(accountID, folder string, uids []uint32) error
	ArchiveEmails(accountID, folder string, uids []uint32) error
	MoveEmails(accountID string, uids []uint32, src, dst string) error
	MarkRead(accountID, folder string, uids []uint32) error
	FetchFolders(accountID string) ([]backend.Folder, error)
	RefreshFolder(accountID, folder string) error
	Subscribe(accountID, folder string) error
	Unsubscribe(accountID, folder string) error
	Events() <-chan *daemonrpc.Event
	IsDaemon() bool
	Close() error
}

Service abstracts daemon-backed vs direct email operations. TUI and CLI use this interface — they don't care which mode is active.

func NewService

func NewService(cfg *config.Config) Service

NewService connects to the daemon, auto-starting it if needed. Falls back to direct mode only if daemon cannot be started.

Jump to

Keyboard shortcuts

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