Documentation
¶
Overview ¶
Code generated by gobusgen; DO NOT EDIT.
Package eventbus provides a typed publish/subscribe event bus for cross-component communication within hive.
Index ¶
- Variables
- func RegisterDebugLogger(bus *EventBus, logger zerolog.Logger)
- type AgentStatusChangedPayload
- type ConfigReloadedPayload
- type Event
- type EventBus
- func (bus *EventBus) OnDrop(fn func(Event, any))
- func (bus *EventBus) OnPanic(fn func(Event, any, any))
- func (bus *EventBus) OnPublish(fn func(Event, any))
- func (bus *EventBus) OnSubscribe(fn func(Event))
- func (bus *EventBus) PublishAgentStatusChanged(payload AgentStatusChangedPayload)
- func (bus *EventBus) PublishConfigReloaded(payload ConfigReloadedPayload)
- func (bus *EventBus) PublishMessageReceived(payload MessageReceivedPayload)
- func (bus *EventBus) PublishSessionCorrupted(payload SessionCorruptedPayload)
- func (bus *EventBus) PublishSessionCreated(payload SessionCreatedPayload)
- func (bus *EventBus) PublishSessionDeleted(payload SessionDeletedPayload)
- func (bus *EventBus) PublishSessionRecycled(payload SessionRecycledPayload)
- func (bus *EventBus) PublishSessionRenamed(payload SessionRenamedPayload)
- func (bus *EventBus) PublishTuiStarted(payload TUIStartedPayload)
- func (bus *EventBus) PublishTuiStopped(payload TUIStoppedPayload)
- func (bus *EventBus) Start(ctx context.Context)
- func (bus *EventBus) SubscribeAgentStatusChanged(fn func(AgentStatusChangedPayload))
- func (bus *EventBus) SubscribeConfigReloaded(fn func(ConfigReloadedPayload))
- func (bus *EventBus) SubscribeMessageReceived(fn func(MessageReceivedPayload))
- func (bus *EventBus) SubscribeSessionCorrupted(fn func(SessionCorruptedPayload))
- func (bus *EventBus) SubscribeSessionCreated(fn func(SessionCreatedPayload))
- func (bus *EventBus) SubscribeSessionDeleted(fn func(SessionDeletedPayload))
- func (bus *EventBus) SubscribeSessionRecycled(fn func(SessionRecycledPayload))
- func (bus *EventBus) SubscribeSessionRenamed(fn func(SessionRenamedPayload))
- func (bus *EventBus) SubscribeTuiStarted(fn func(TUIStartedPayload))
- func (bus *EventBus) SubscribeTuiStopped(fn func(TUIStoppedPayload))
- type MessageReceivedPayload
- type SessionCorruptedPayload
- type SessionCreatedPayload
- type SessionDeletedPayload
- type SessionRecycledPayload
- type SessionRenamedPayload
- type TUIStartedPayload
- type TUIStoppedPayload
Constants ¶
This section is empty.
Variables ¶
var Events = map[string]any{ "agent.status-changed": AgentStatusChangedPayload{}, "config.reloaded": ConfigReloadedPayload{}, "message.received": MessageReceivedPayload{}, "session.corrupted": SessionCorruptedPayload{}, "session.created": SessionCreatedPayload{}, "session.deleted": SessionDeletedPayload{}, "session.recycled": SessionRecycledPayload{}, "session.renamed": SessionRenamedPayload{}, "tui.started": TUIStartedPayload{}, "tui.stopped": TUIStoppedPayload{}, }
Events defines all event types and their payload structs for code generation.
Functions ¶
func RegisterDebugLogger ¶
RegisterDebugLogger registers bus hooks that log all event activity at debug level. Uses OnPublish for event firing, OnDrop for buffer-full warnings, and OnPanic for subscriber panic reporting.
Types ¶
type AgentStatusChangedPayload ¶
type AgentStatusChangedPayload struct {
Session *session.Session
OldStatus terminal.Status
NewStatus terminal.Status
}
AgentStatusChangedPayload is emitted when an agent's terminal status changes.
type ConfigReloadedPayload ¶
ConfigReloadedPayload is emitted when configuration is reloaded.
type Event ¶
type Event string
Event represents a typed event name.
const ( EventAgentStatusChanged Event = "agent.status-changed" EventConfigReloaded Event = "config.reloaded" EventMessageReceived Event = "message.received" EventSessionCorrupted Event = "session.corrupted" EventSessionCreated Event = "session.created" EventSessionDeleted Event = "session.deleted" EventSessionRecycled Event = "session.recycled" EventSessionRenamed Event = "session.renamed" EventTuiStarted Event = "tui.started" EventTuiStopped Event = "tui.stopped" )
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
EventBus provides type-safe publish/subscribe for in-process events.
func (*EventBus) OnDrop ¶
OnDrop registers a hook that fires when an event is dropped due to a full buffer.
func (*EventBus) OnPublish ¶
OnPublish registers a hook that fires after an event is successfully enqueued.
func (*EventBus) OnSubscribe ¶
OnSubscribe registers a hook that fires after a subscriber is registered.
func (*EventBus) PublishAgentStatusChanged ¶
func (bus *EventBus) PublishAgentStatusChanged(payload AgentStatusChangedPayload)
PublishAgentStatusChanged publishes a agent.status-changed event.
func (*EventBus) PublishConfigReloaded ¶
func (bus *EventBus) PublishConfigReloaded(payload ConfigReloadedPayload)
PublishConfigReloaded publishes a config.reloaded event.
func (*EventBus) PublishMessageReceived ¶
func (bus *EventBus) PublishMessageReceived(payload MessageReceivedPayload)
PublishMessageReceived publishes a message.received event.
func (*EventBus) PublishSessionCorrupted ¶
func (bus *EventBus) PublishSessionCorrupted(payload SessionCorruptedPayload)
PublishSessionCorrupted publishes a session.corrupted event.
func (*EventBus) PublishSessionCreated ¶
func (bus *EventBus) PublishSessionCreated(payload SessionCreatedPayload)
PublishSessionCreated publishes a session.created event.
func (*EventBus) PublishSessionDeleted ¶
func (bus *EventBus) PublishSessionDeleted(payload SessionDeletedPayload)
PublishSessionDeleted publishes a session.deleted event.
func (*EventBus) PublishSessionRecycled ¶
func (bus *EventBus) PublishSessionRecycled(payload SessionRecycledPayload)
PublishSessionRecycled publishes a session.recycled event.
func (*EventBus) PublishSessionRenamed ¶
func (bus *EventBus) PublishSessionRenamed(payload SessionRenamedPayload)
PublishSessionRenamed publishes a session.renamed event.
func (*EventBus) PublishTuiStarted ¶
func (bus *EventBus) PublishTuiStarted(payload TUIStartedPayload)
PublishTuiStarted publishes a tui.started event.
func (*EventBus) PublishTuiStopped ¶
func (bus *EventBus) PublishTuiStopped(payload TUIStoppedPayload)
PublishTuiStopped publishes a tui.stopped event.
func (*EventBus) SubscribeAgentStatusChanged ¶
func (bus *EventBus) SubscribeAgentStatusChanged(fn func(AgentStatusChangedPayload))
SubscribeAgentStatusChanged registers a handler for agent.status-changed events.
func (*EventBus) SubscribeConfigReloaded ¶
func (bus *EventBus) SubscribeConfigReloaded(fn func(ConfigReloadedPayload))
SubscribeConfigReloaded registers a handler for config.reloaded events.
func (*EventBus) SubscribeMessageReceived ¶
func (bus *EventBus) SubscribeMessageReceived(fn func(MessageReceivedPayload))
SubscribeMessageReceived registers a handler for message.received events.
func (*EventBus) SubscribeSessionCorrupted ¶
func (bus *EventBus) SubscribeSessionCorrupted(fn func(SessionCorruptedPayload))
SubscribeSessionCorrupted registers a handler for session.corrupted events.
func (*EventBus) SubscribeSessionCreated ¶
func (bus *EventBus) SubscribeSessionCreated(fn func(SessionCreatedPayload))
SubscribeSessionCreated registers a handler for session.created events.
func (*EventBus) SubscribeSessionDeleted ¶
func (bus *EventBus) SubscribeSessionDeleted(fn func(SessionDeletedPayload))
SubscribeSessionDeleted registers a handler for session.deleted events.
func (*EventBus) SubscribeSessionRecycled ¶
func (bus *EventBus) SubscribeSessionRecycled(fn func(SessionRecycledPayload))
SubscribeSessionRecycled registers a handler for session.recycled events.
func (*EventBus) SubscribeSessionRenamed ¶
func (bus *EventBus) SubscribeSessionRenamed(fn func(SessionRenamedPayload))
SubscribeSessionRenamed registers a handler for session.renamed events.
func (*EventBus) SubscribeTuiStarted ¶
func (bus *EventBus) SubscribeTuiStarted(fn func(TUIStartedPayload))
SubscribeTuiStarted registers a handler for tui.started events.
func (*EventBus) SubscribeTuiStopped ¶
func (bus *EventBus) SubscribeTuiStopped(fn func(TUIStoppedPayload))
SubscribeTuiStopped registers a handler for tui.stopped events.
type MessageReceivedPayload ¶
MessageReceivedPayload is emitted when a message is received on a topic.
type SessionCorruptedPayload ¶
SessionCorruptedPayload is emitted when a session is marked corrupted.
type SessionCreatedPayload ¶
SessionCreatedPayload is emitted when a new session is created.
type SessionDeletedPayload ¶
type SessionDeletedPayload struct {
SessionID string
}
SessionDeletedPayload is emitted when a session is deleted.
type SessionRecycledPayload ¶
SessionRecycledPayload is emitted when a session is recycled.
type SessionRenamedPayload ¶
SessionRenamedPayload is emitted when a session is renamed.
type TUIStartedPayload ¶
type TUIStartedPayload struct{}
TUIStartedPayload is emitted when the TUI starts.
type TUIStoppedPayload ¶
type TUIStoppedPayload struct{}
TUIStoppedPayload is emitted when the TUI stops.