daemonrpc

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeParse         = udsrpc.ErrCodeParse
	ErrCodeInvalidReq    = udsrpc.ErrCodeInvalidReq
	ErrCodeInvalidParams = udsrpc.ErrCodeInvalidParams
	ErrCodeNotFound      = udsrpc.ErrCodeNotFound
	ErrCodeInternal      = udsrpc.ErrCodeInternal
)

Standard error codes, re-exported from the shared library.

View Source
const (
	MethodPing            = "Ping"
	MethodGetStatus       = "GetStatus"
	MethodGetAccounts     = "GetAccounts"
	MethodReloadConfig    = "ReloadConfig"
	MethodFetchEmails     = "FetchEmails"
	MethodFetchEmailBody  = "FetchEmailBody"
	MethodSendEmail       = "SendEmail"
	MethodDeleteEmails    = "DeleteEmails"
	MethodArchiveEmails   = "ArchiveEmails"
	MethodMoveEmails      = "MoveEmails"
	MethodMarkRead        = "MarkRead"
	MethodFetchFolders    = "FetchFolders"
	MethodRefreshFolder   = "RefreshFolder"
	MethodSubscribe       = "Subscribe"
	MethodUnsubscribe     = "Unsubscribe"
	MethodSendRSVP        = "SendRSVP"
	MethodGetCachedEmails = "GetCachedEmails"
	MethodGetCachedBody   = "GetCachedBody"
	MethodExportContacts  = "ExportContacts"
	MethodQueueEmail      = "QueueEmail"
	MethodCancelEmail     = "CancelEmail"
)

RPC method names.

View Source
const (
	EventNewMail        = "NewMail"
	EventSyncStarted    = "SyncStarted"
	EventSyncComplete   = "SyncComplete"
	EventSyncError      = "SyncError"
	EventEmailsUpdated  = "EmailsUpdated"
	EventConfigReloaded = "ConfigReloaded"
)

Event type names.

Variables

View Source
var DecodeMessage = udsrpc.DecodeMessage

DecodeMessage discriminates a raw JSON object into a Request, Response, or Event.

View Source
var NewConn = udsrpc.NewConn

NewConn wraps an existing net.Conn.

Functions

func EnsureRuntimeDir

func EnsureRuntimeDir() error

EnsureRuntimeDir creates the runtime directory if it doesn't exist.

func PIDPath

func PIDPath() string

PIDPath returns the path to the daemon's PID file.

func SocketPath

func SocketPath() string

SocketPath returns the path to the daemon's Unix domain socket.

Types

type AccountInfo

type AccountInfo struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Email    string `json:"email"`
	Protocol string `json:"protocol"`
}

type ArchiveEmailsParams

type ArchiveEmailsParams struct {
	AccountID string   `json:"account_id"`
	Folder    string   `json:"folder"`
	UIDs      []uint32 `json:"uids"`
}

type AttachmentInfo

type AttachmentInfo struct {
	Filename         string `json:"filename"`
	PartID           string `json:"part_id"`
	Encoding         string `json:"encoding"`
	MIMEType         string `json:"mime_type"`
	IsCalendarInvite bool   `json:"is_calendar_invite,omitempty"`
	CalendarData     []byte `json:"calendar_data,omitempty"`
}

type CancelEmailParams added in v0.41.0

type CancelEmailParams struct {
	JobID string `json:"job_id"`
}

type Conn

type Conn = udsrpc.Conn

Conn is the newline-delimited JSON-RPC connection provided by the shared go-uds-jsonrpc transport. Aliased so the rest of matcha keeps referring to daemonrpc.Conn.

type DeleteEmailsParams

type DeleteEmailsParams struct {
	AccountID string   `json:"account_id"`
	Folder    string   `json:"folder"`
	UIDs      []uint32 `json:"uids"`
}

type Error

type Error = udsrpc.Error

Wire-level message types and the discriminating decoder live in the shared go-uds-jsonrpc library. They are aliased here so matcha code keeps using the daemonrpc.* names while sharing a single implementation with the daemon's transport layer.

type Event

type Event = udsrpc.Event

Wire-level message types and the discriminating decoder live in the shared go-uds-jsonrpc library. They are aliased here so matcha code keeps using the daemonrpc.* names while sharing a single implementation with the daemon's transport layer.

type ExportContactsParams

type ExportContactsParams struct {
	Format string `json:"format"` // "json" or "csv"
}

type FetchEmailBodyParams

type FetchEmailBodyParams struct {
	AccountID string `json:"account_id"`
	Folder    string `json:"folder"`
	UID       uint32 `json:"uid"`
}

type FetchEmailBodyResult

type FetchEmailBodyResult struct {
	Body         string           `json:"body"`
	BodyMIMEType string           `json:"body_mime_type,omitempty"`
	Attachments  []AttachmentInfo `json:"attachments"`
}

type FetchEmailsParams

type FetchEmailsParams struct {
	AccountID string `json:"account_id"`
	Folder    string `json:"folder"`
	Limit     uint32 `json:"limit"`
	Offset    uint32 `json:"offset"`
}

type FetchFoldersParams

type FetchFoldersParams struct {
	AccountID string `json:"account_id"`
}

type GetCachedBodyParams

type GetCachedBodyParams struct {
	Folder    string `json:"folder"`
	UID       uint32 `json:"uid"`
	AccountID string `json:"account_id"`
}

type GetCachedEmailsParams

type GetCachedEmailsParams struct {
	Folder string `json:"folder"`
}

type MarkReadParams

type MarkReadParams struct {
	AccountID string   `json:"account_id"`
	Folder    string   `json:"folder"`
	UIDs      []uint32 `json:"uids"`
	Read      bool     `json:"read"`
}

type Message

type Message = udsrpc.Message

Wire-level message types and the discriminating decoder live in the shared go-uds-jsonrpc library. They are aliased here so matcha code keeps using the daemonrpc.* names while sharing a single implementation with the daemon's transport layer.

type MoveEmailsParams

type MoveEmailsParams struct {
	AccountID    string   `json:"account_id"`
	UIDs         []uint32 `json:"uids"`
	SourceFolder string   `json:"source_folder"`
	DestFolder   string   `json:"dest_folder"`
}

type NewMailEvent

type NewMailEvent struct {
	AccountID string `json:"account_id"`
	Folder    string `json:"folder"`
}

type PingResult

type PingResult struct {
	Pong bool `json:"pong"`
}

type QueueEmailParams added in v0.41.0

type QueueEmailParams struct {
	Email        SendEmailParams `json:"email"`
	DelaySeconds int             `json:"delay_seconds"`
}

type QueueEmailResult added in v0.41.0

type QueueEmailResult struct {
	JobID string `json:"job_id"`
}

type RefreshFolderParams

type RefreshFolderParams struct {
	AccountID string `json:"account_id"`
	Folder    string `json:"folder"`
}

type Request

type Request = udsrpc.Request

Wire-level message types and the discriminating decoder live in the shared go-uds-jsonrpc library. They are aliased here so matcha code keeps using the daemonrpc.* names while sharing a single implementation with the daemon's transport layer.

type Response

type Response = udsrpc.Response

Wire-level message types and the discriminating decoder live in the shared go-uds-jsonrpc library. They are aliased here so matcha code keeps using the daemonrpc.* names while sharing a single implementation with the daemon's transport layer.

type SendEmailParams

type SendEmailParams struct {
	AccountID    string            `json:"account_id"`
	To           []string          `json:"to"`
	Cc           []string          `json:"cc,omitempty"`
	Bcc          []string          `json:"bcc,omitempty"`
	Subject      string            `json:"subject"`
	Body         string            `json:"body"`
	HTMLBody     string            `json:"html_body,omitempty"`
	Images       map[string][]byte `json:"images,omitempty"`
	Attachments  map[string][]byte `json:"attachments,omitempty"`
	InReplyTo    string            `json:"in_reply_to,omitempty"`
	References   []string          `json:"references,omitempty"`
	SignSMIME    bool              `json:"sign_smime,omitempty"`
	EncryptSMIME bool              `json:"encrypt_smime,omitempty"`
	SignPGP      bool              `json:"sign_pgp,omitempty"`
	EncryptPGP   bool              `json:"encrypt_pgp,omitempty"`
}

type SendRSVPParams

type SendRSVPParams struct {
	AccountID   string   `json:"account_id"`
	OriginalICS []byte   `json:"original_ics"`
	Response    string   `json:"response"`
	InReplyTo   string   `json:"in_reply_to,omitempty"`
	References  []string `json:"references,omitempty"`
}

type StatusResult

type StatusResult struct {
	Running  bool     `json:"running"`
	Uptime   int64    `json:"uptime_seconds"`
	Accounts []string `json:"accounts"`
	PID      int      `json:"pid"`
}

type SubscribeParams

type SubscribeParams struct {
	AccountID string `json:"account_id"`
	Folder    string `json:"folder"`
}

type SyncCompleteEvent

type SyncCompleteEvent struct {
	AccountID  string `json:"account_id"`
	Folder     string `json:"folder"`
	EmailCount int    `json:"email_count"`
}

type SyncErrorEvent

type SyncErrorEvent struct {
	AccountID string `json:"account_id"`
	Folder    string `json:"folder"`
	Error     string `json:"error"`
}

type SyncStartedEvent

type SyncStartedEvent struct {
	AccountID string `json:"account_id"`
	Folder    string `json:"folder"`
}

type UnsubscribeParams

type UnsubscribeParams struct {
	AccountID string `json:"account_id"`
	Folder    string `json:"folder"`
}

Jump to

Keyboard shortcuts

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