messaging

package
v0.0.0-...-f75e7f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrokerTypeNATS     = "nats"
	BrokerTypeKafka    = "kafka"
	BrokerTypeRabbitMQ = "rabbitmq"
)

Variables

This section is empty.

Functions

func HandleMessage

func HandleMessage(handler MessageHandlerFunc, topicName string, payload []byte) (err error)

Types

type JetStreamListener

type JetStreamListener struct {
	// contains filtered or unexported fields
}

func NewJetStreamListener

func NewJetStreamListener(config configuration.NatsConfiguration, handler MessageHandlerFunc) (listener *JetStreamListener, err error)

func (*JetStreamListener) BrokerType

func (listener *JetStreamListener) BrokerType() string

func (*JetStreamListener) Close

func (listener *JetStreamListener) Close()

func (*JetStreamListener) HealthCheck

func (listener *JetStreamListener) HealthCheck(ctx context.Context) error

type KafkaListener

type KafkaListener struct {
	// contains filtered or unexported fields
}

func NewKafkaListener

func NewKafkaListener(config configuration.KafkaConfiguration, handler MessageHandlerFunc) (listener *KafkaListener, err error)

func (*KafkaListener) BrokerType

func (listener *KafkaListener) BrokerType() string

func (*KafkaListener) Close

func (listener *KafkaListener) Close()

func (*KafkaListener) HealthCheck

func (listener *KafkaListener) HealthCheck(ctx context.Context) error

type KafkaSubscription

type KafkaSubscription struct {
	Name    string
	Topic   string
	GroupID string
	// contains filtered or unexported fields
}

type Listener

type Listener interface {
	HealthCheck(ctx context.Context) error
	Close()
	BrokerType() string
}

func NewListener

func NewListener(config configuration.BrokerConfiguration, handler MessageHandlerFunc) (listener Listener, err error)

type MessageHandlerFunc

type MessageHandlerFunc func(topicName string, payload []byte) error

type NatsSubscription

type NatsSubscription struct {
	Name            string
	Topic           string
	Stream          string
	DurableConsumer string
	QueueGroup      string
	// contains filtered or unexported fields
}

type RabbitMQListener

type RabbitMQListener struct {
	// contains filtered or unexported fields
}

func NewRabbitMQListener

func NewRabbitMQListener(config configuration.RabbitMQConfiguration, handler MessageHandlerFunc) (listener *RabbitMQListener, err error)

func (*RabbitMQListener) BrokerType

func (listener *RabbitMQListener) BrokerType() string

func (*RabbitMQListener) Close

func (listener *RabbitMQListener) Close()

func (*RabbitMQListener) HealthCheck

func (listener *RabbitMQListener) HealthCheck(ctx context.Context) error

type RabbitMQSubscription

type RabbitMQSubscription struct {
	Name        string
	Queue       string
	Exchange    string
	RoutingKey  string
	ConsumerTag string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL