Documentation
¶
Index ¶
- type EventBus
- func (eb *EventBus) Clear()
- func (eb *EventBus) EmitControl(event interface{}) types.AgentEventEnvelope
- func (eb *EventBus) EmitMonitor(event interface{}) types.AgentEventEnvelope
- func (eb *EventBus) EmitProgress(event interface{}) types.AgentEventEnvelope
- func (eb *EventBus) GetCursor() int64
- func (eb *EventBus) GetLastBookmark() *types.Bookmark
- func (eb *EventBus) GetTimeline() []types.AgentEventEnvelope
- func (eb *EventBus) OnControl(eventType string, handler EventHandler) func()
- func (eb *EventBus) OnMonitor(eventType string, handler EventHandler) func()
- func (eb *EventBus) Subscribe(channels []types.AgentChannel, opts *types.SubscribeOptions) <-chan types.AgentEventEnvelope
- func (eb *EventBus) Unsubscribe(ch <-chan types.AgentEventEnvelope)
- type EventHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
EventBus 三通道事件总线
func (*EventBus) EmitControl ¶
func (eb *EventBus) EmitControl(event interface{}) types.AgentEventEnvelope
EmitControl 发送Control事件
func (*EventBus) EmitMonitor ¶
func (eb *EventBus) EmitMonitor(event interface{}) types.AgentEventEnvelope
EmitMonitor 发送Monitor事件
func (*EventBus) EmitProgress ¶
func (eb *EventBus) EmitProgress(event interface{}) types.AgentEventEnvelope
EmitProgress 发送Progress事件
func (*EventBus) GetLastBookmark ¶
GetLastBookmark 获取最后一个bookmark
func (*EventBus) GetTimeline ¶
func (eb *EventBus) GetTimeline() []types.AgentEventEnvelope
GetTimeline 获取完整时间线
func (*EventBus) OnControl ¶
func (eb *EventBus) OnControl(eventType string, handler EventHandler) func()
OnControl 注册Control事件处理器
func (*EventBus) OnMonitor ¶
func (eb *EventBus) OnMonitor(eventType string, handler EventHandler) func()
OnMonitor 注册Monitor事件处理器
func (*EventBus) Subscribe ¶
func (eb *EventBus) Subscribe(channels []types.AgentChannel, opts *types.SubscribeOptions) <-chan types.AgentEventEnvelope
Subscribe 订阅指定通道的事件(返回channel)
func (*EventBus) Unsubscribe ¶
func (eb *EventBus) Unsubscribe(ch <-chan types.AgentEventEnvelope)
Unsubscribe 取消订阅
Click to show internal directories.
Click to hide internal directories.