plugin

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HookStartup         = "startup"
	HookShutdown        = "shutdown"
	HookEmailReceived   = "email_received"
	HookEmailSendBefore = "email_send_before"
	HookEmailSendAfter  = "email_send_after"
	HookEmailViewed     = "email_viewed"
	HookFolderChanged   = "folder_changed"
	HookComposerUpdated = "composer_updated"
)

Hook event names.

View Source
const (
	StatusInbox     = "inbox"
	StatusComposer  = "composer"
	StatusEmailView = "email_view"
)

Status area names.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages the Lua VM and loaded plugins.

func NewManager

func NewManager() *Manager

NewManager creates a new plugin manager with a Lua VM.

func (*Manager) CallComposerHook

func (m *Manager) CallComposerHook(event string, body, subject, to string)

CallComposerHook calls a hook with composer state info.

func (*Manager) CallFolderHook

func (m *Manager) CallFolderHook(event string, folderName string)

CallFolderHook calls a hook with a folder name.

func (*Manager) CallHook

func (m *Manager) CallHook(event string, args ...lua.LValue)

CallHook invokes all callbacks registered for the given event.

func (*Manager) CallSendHook

func (m *Manager) CallSendHook(event string, to, cc, subject, accountID string)

CallSendHook calls a hook with email send metadata.

func (*Manager) Close

func (m *Manager) Close()

Close shuts down the Lua VM.

func (*Manager) EmailToTable

func (m *Manager) EmailToTable(uid uint32, from string, to []string, subject string, date time.Time, isRead bool, accountID string, folder string) *lua.LTable

EmailToTable converts email fields into a Lua table.

func (*Manager) LoadPlugins

func (m *Manager) LoadPlugins()

LoadPlugins discovers and loads plugins from ~/.config/matcha/plugins/.

func (*Manager) Plugins

func (m *Manager) Plugins() []string

Plugins returns the names of all loaded plugins.

func (*Manager) StatusText

func (m *Manager) StatusText(area string) string

StatusText returns the plugin status string for the given view area.

func (*Manager) TakePendingNotification

func (m *Manager) TakePendingNotification() (PendingNotification, bool)

TakePendingNotification returns and clears any pending notification.

type PendingNotification

type PendingNotification struct {
	Message  string
	Duration float64 // seconds, 0 means default
}

PendingNotification holds a notification message and its display duration.

Jump to

Keyboard shortcuts

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