publishmq

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidTopic  = errors.New("invalid topic")
	ErrRequiredTopic = errors.New("topic is required")
)

Functions

func NewMessageHandler

func NewMessageHandler(eventHandler EventHandler) consumer.MessageHandler

func WithQueue

func WithQueue(queueConfig *mqs.QueueConfig) func(opts *PublishMQOption)

Types

type EventHandler

type EventHandler interface {
	Handle(ctx context.Context, event *models.Event) error
}

func NewEventHandler

func NewEventHandler(
	logger *logging.Logger,
	redisClient *redis.Client,
	deliveryMQ *deliverymq.DeliveryMQ,
	entityStore models.EntityStore,
	eventTracer eventtracer.EventTracer,
	topics []string,
) EventHandler

type PublishMQ

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

func New

func New(opts ...func(opts *PublishMQOption)) *PublishMQ

func (*PublishMQ) Subscribe

func (q *PublishMQ) Subscribe(ctx context.Context) (mqs.Subscription, error)

type PublishMQOption

type PublishMQOption struct {
	QueueConfig *mqs.QueueConfig
}

type PublishedEvent

type PublishedEvent struct {
	ID               string                 `json:"id"`
	TenantID         string                 `json:"tenant_id" binding:"required"`
	DestinationID    string                 `json:"destination_id"`
	Topic            string                 `json:"topic"`
	EligibleForRetry *bool                  `json:"eligible_for_retry"`
	Time             time.Time              `json:"time"`
	Metadata         map[string]string      `json:"metadata"`
	Data             map[string]interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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