Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokerService ¶
type BrokerService struct { Consumer Consumer // Represents the consumer interface for interacting with the message broker. Publisher Publisher // Represents the publisher interface for interacting with the message broker. }
BrokerService represents a service that interacts with a message broker.
func NewBroker ¶
func NewBroker(consumer Consumer, publisher Publisher) *BrokerService
NewBroker creates a new instance of BrokerService with the provided consumer and publisher implementations.
type Consumer ¶
type Consumer interface { // ConsumeMessage consumes messages on the specified topic. ConsumeMessage(topic string) (<-chan Message, error) // Close closes the consumer. Close() error }
Consumer defines the interface for a message consumer.
type Message ¶
Message represents a message in the pub/sub system.
func NewMessage ¶
NewMessage creates a new message with the given topic, payload, and metadata.
Click to show internal directories.
Click to hide internal directories.