Documentation
¶
Index ¶
- func NewConnection(pCfg *apis.PublisherCfg) (*rabbitmq.Conn, error)
- func NewProducer(pCfg *apis.PublisherCfg) (sarama.SyncProducer, error)
- func NewPublisher(topic string, conn *rabbitmq.Conn) (*rabbitmq.Publisher, error)
- type GooglePubSubPublisher
- type KafkaPublisher
- type NatsPublisher
- type PubSubConnection
- type RabbitPublisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnection ¶
func NewConnection(pCfg *apis.PublisherCfg) (*rabbitmq.Conn, error)
NewConnection creates a new RabbitMQ connection manager.
func NewProducer ¶
func NewProducer(pCfg *apis.PublisherCfg) (sarama.SyncProducer, error)
NewProducer return new Kafka producer instance.
Types ¶
type GooglePubSubPublisher ¶
type GooglePubSubPublisher struct {
// contains filtered or unexported fields
}
GooglePubSubPublisher represent Pub/Sub publisher.
func NewGooglePubSubPublisher ¶
func NewGooglePubSubPublisher(pubSubConnection *PubSubConnection) *GooglePubSubPublisher
NewGooglePubSubPublisher create new instance of GooglePubSubPublisher.
func (*GooglePubSubPublisher) Close ¶
func (p *GooglePubSubPublisher) Close() error
type KafkaPublisher ¶
type KafkaPublisher struct {
// contains filtered or unexported fields
}
KafkaPublisher represent event publisher with Kafka broker.
func NewKafkaPublisher ¶
func NewKafkaPublisher(producer sarama.SyncProducer) *KafkaPublisher
NewKafkaPublisher return new KafkaPublisher instance.
type NatsPublisher ¶
type NatsPublisher struct {
// contains filtered or unexported fields
}
NatsPublisher represent event publisher.
func NewNatsPublisher ¶
NewNatsPublisher return new NatsPublisher instance.
func (NatsPublisher) WaitForStreamToBeCreated ¶ added in v0.0.2
func (n NatsPublisher) WaitForStreamToBeCreated(ctx context.Context, streamName string) error
WaitForStreamToBeCreated polls every 2 seconds until the stream with the given name is found. It returns an error if the context is canceled or times out.
type PubSubConnection ¶
type PubSubConnection struct {
// contains filtered or unexported fields
}
PubSubConnection represent Pub/Sub connection.
func NewPubSubConnection ¶
func NewPubSubConnection(ctx context.Context, logger *slog.Logger, pubSubProjectID string) (*PubSubConnection, error)
NewPubSubConnection create new connection with specified project id.
func (*PubSubConnection) Close ¶
func (c *PubSubConnection) Close() error
type RabbitPublisher ¶
type RabbitPublisher struct {
// contains filtered or unexported fields
}
RabbitPublisher represent event publisher for RabbitMQ.
func NewRabbitPublisher ¶
func NewRabbitPublisher(pubTopic string, conn *rabbitmq.Conn, publisher *rabbitmq.Publisher) (*RabbitPublisher, error)
NewRabbitPublisher create new RabbitPublisher instance.
func (*RabbitPublisher) Close ¶
func (p *RabbitPublisher) Close() error
Close represent finalization for RabbitMQ publisher.