Documentation
¶
Index ¶
- Constants
- type KeyBinding
- type Manager
- func (m *Manager) Bindings(area string) []KeyBinding
- func (m *Manager) CallComposerHook(event string, body, subject, to, cc, bcc string)
- func (m *Manager) CallFolderHook(event string, folderName string)
- func (m *Manager) CallHook(event string, args ...lua.LValue)
- func (m *Manager) CallKeyBinding(binding KeyBinding, args ...lua.LValue)
- func (m *Manager) CallSendHook(event string, to, cc, subject, accountID string)
- func (m *Manager) Close()
- func (m *Manager) EmailToTable(uid uint32, from string, to []string, subject string, date time.Time, ...) *lua.LTable
- func (m *Manager) LoadPlugins()
- func (m *Manager) LuaState() *lua.LState
- func (m *Manager) Plugins() []string
- func (m *Manager) StatusText(area string) string
- func (m *Manager) TakePendingFields() map[string]string
- func (m *Manager) TakePendingNotification() (PendingNotification, bool)
- type PendingNotification
Constants ¶
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.
const ( StatusInbox = "inbox" StatusComposer = "composer" StatusEmailView = "email_view" )
Status area names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyBinding ¶ added in v0.30.0
type KeyBinding struct {
Key string
Area string // "inbox", "email_view", or "composer"
Description string
Fn *lua.LFunction
}
KeyBinding represents a plugin-registered keyboard shortcut.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the Lua VM and loaded plugins.
func (*Manager) Bindings ¶ added in v0.30.0
func (m *Manager) Bindings(area string) []KeyBinding
Bindings returns all plugin-registered key bindings for the given view area.
func (*Manager) CallComposerHook ¶
CallComposerHook calls a hook with composer state info.
func (*Manager) CallFolderHook ¶
CallFolderHook calls a hook with a folder name.
func (*Manager) CallKeyBinding ¶ added in v0.30.0
func (m *Manager) CallKeyBinding(binding KeyBinding, args ...lua.LValue)
CallKeyBinding invokes a plugin key binding callback with the given arguments.
func (*Manager) CallSendHook ¶
CallSendHook calls a hook with email send metadata.
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) StatusText ¶
StatusText returns the plugin status string for the given view area.
func (*Manager) TakePendingFields ¶ added in v0.30.0
TakePendingFields returns and clears any pending compose field updates.
func (*Manager) TakePendingNotification ¶
func (m *Manager) TakePendingNotification() (PendingNotification, bool)
TakePendingNotification returns and clears any pending notification.
type PendingNotification ¶
PendingNotification holds a notification message and its display duration.