Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DistributedPublisher ¶
type DistributedPublisher struct {
// contains filtered or unexported fields
}
DistributedPublisher implements a distributed pub/sub system using database storage.
func NewDistributed ¶
func NewDistributed(store store.Store, instanceID string) *DistributedPublisher
NewDistributed creates a distributed publisher that works across multiple instances.
func (*DistributedPublisher) Close ¶
func (p *DistributedPublisher) Close() error
Close shuts down the distributed publisher.
func (*DistributedPublisher) Publish ¶
func (p *DistributedPublisher) Publish(message Message)
Publish publishes a message to all subscribers across all instances.
type MemoryPublisher ¶
func (*MemoryPublisher) Publish ¶
func (p *MemoryPublisher) Publish(message Message)
type Message ¶
type Message struct {
// ID identifies this message.
ID string `json:"id,omitempty"`
// Data is the actual data in the entry.
Data []byte `json:"data"`
// Labels represents the key-value pairs the entry is labeled with.
Labels map[string]string `json:"labels,omitempty"`
}
Message defines a published message.
Click to show internal directories.
Click to hide internal directories.