Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker manages event subscriptions and distribution
func (*Broker) Subscribe ¶
func (b *Broker) Subscribe() Subscriber
Subscribe creates a new subscription and returns a channel
func (*Broker) SubscriberCount ¶
SubscriberCount returns the number of active subscribers
func (*Broker) Unsubscribe ¶
func (b *Broker) Unsubscribe(sub Subscriber)
Unsubscribe removes a subscription
type Event ¶
type Event struct {
ID string
Type EventType
Timestamp time.Time
Message string
Metadata map[string]string
}
Event represents a cluster event
type EventType ¶
type EventType string
EventType represents the type of event
const ( EventServiceCreated EventType = "service.created" EventServiceUpdated EventType = "service.updated" EventServiceDeleted EventType = "service.deleted" EventTaskCreated EventType = "task.created" EventTaskFailed EventType = "task.failed" EventTaskCompleted EventType = "task.completed" EventNodeJoined EventType = "node.joined" EventNodeLeft EventType = "node.left" EventNodeDown EventType = "node.down" EventSecretCreated EventType = "secret.created" EventSecretDeleted EventType = "secret.deleted" EventVolumeCreated EventType = "volume.created" EventVolumeDeleted EventType = "volume.deleted" )
Click to show internal directories.
Click to hide internal directories.