Documentation
¶
Overview ¶
Package hooks provides the event system for Kairo - allowing plugins to react to app events
Index ¶
- type Event
- type EventType
- type Listener
- type Manager
- func (m *Manager) AppStarted()
- func (m *Manager) AppStopped()
- func (m *Manager) Emit(event Event)
- func (m *Manager) Off(eventType EventType)
- func (m *Manager) On(eventType EventType, listener Listener)
- func (m *Manager) TaskCreated(task core.Task)
- func (m *Manager) TaskDeleteAll()
- func (m *Manager) TaskDeleted(taskID string)
- func (m *Manager) TaskUpdated(task core.Task, patch core.TaskPatch)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Type EventType
Task *core.Task // Nil for app lifecycle events
Patch *core.TaskPatch // Nil except for task_update
Error error // Nil if success
Payload map[string]interface{} // Additional context
}
Event represents an application event that plugins can subscribe to
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages event hooks for the application
func (*Manager) Emit ¶
Emit triggers all listeners for an event type Listeners are called synchronously in registration order
func (*Manager) Off ¶
Off removes all listeners for an event type Note: In this implementation, we only provide removal by event type
func (*Manager) TaskCreated ¶
TaskCreated emits a task creation event
func (*Manager) TaskDeleteAll ¶
func (m *Manager) TaskDeleteAll()
TaskDeleteAll emits a bulk task deletion event
func (*Manager) TaskDeleted ¶
TaskDeleted emits a task deletion event
Click to show internal directories.
Click to hide internal directories.