Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Service string `json:"service"`
Type string `json:"type"`
Payload map[string]any `json:"payload"`
}
Event represents a generic event structure for the event queue
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer wraps the base queue producer for publishing events
func NewProducer ¶
func NewProducer(connConfig queue.ConnectionConfig, config ProducerConfig) (*Producer, error)
NewProducer creates a new event producer
func (*Producer) IsConnected ¶
IsConnected returns true if the producer has a valid connection
func (*Producer) PublishAsync ¶
PublishAsync publishes an event asynchronously (fire and forget)
func (*Producer) ServiceName ¶
ServiceName returns the service name configured for this producer
type ProducerConfig ¶
type ProducerConfig struct {
// ServiceName is the name of the service publishing events
ServiceName string
// QueueConfig allows overriding the default queue configuration (optional)
QueueConfig *queue.Config
}
ProducerConfig holds configuration for the event producer
Click to show internal directories.
Click to hide internal directories.