msgconfig

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderRedis is used to refer to redis.
	ProviderRedis provider = "redis"
	// ProviderSQS is used to refer to sqs.
	ProviderSQS provider = "sqs"
	// ProviderPubSub is used to refer to GCP Pub/Sub.
	ProviderPubSub provider = "pubsub"
)

Variables

View Source
var (
	ErrNilConfig = errors.New("nil config provided")
)
View Source
var (
	// MessageQueueProviders are what we provide to dependency injection.
	MessageQueueProviders = wire.NewSet(
		ProvideConsumerProvider,
		ProvidePublisherProvider,
	)
)

Functions

func ProvideConsumerProvider

func ProvideConsumerProvider(ctx context.Context, logger logging.Logger, tracerProvider tracing.TracerProvider, c *Config) (messagequeue.ConsumerProvider, error)

ProvideConsumerProvider provides a ConsumerProvider.

func ProvidePublisherProvider

func ProvidePublisherProvider(ctx context.Context, logger logging.Logger, tracerProvider tracing.TracerProvider, c *Config) (messagequeue.PublisherProvider, error)

ProvidePublisherProvider provides a PublisherProvider.

func RegisterMessageQueue

func RegisterMessageQueue(i do.Injector)

RegisterMessageQueue registers both messagequeue.ConsumerProvider and messagequeue.PublisherProvider with the injector.

Types

type Config

type Config struct {
	Consumer  MessageQueueConfig `envPrefix:"CONSUMER_"  json:"consumers"`
	Publisher MessageQueueConfig `envPrefix:"PUBLISHER_" json:"publishers"`
	// contains filtered or unexported fields
}

Config is used to indicate how the messaging provider should be configured.

type MessageQueueConfig

type MessageQueueConfig struct {
	Provider provider      `env:"PROVIDER"      json:"provider,omitempty"`
	SQS      sqs.Config    `envPrefix:"SQS_"    json:"sqs"`
	PubSub   pubsub.Config `envPrefix:"PUBSUB_" json:"pubSub"`
	Redis    redis.Config  `envPrefix:"REDIS_"  json:"redis"`
	// contains filtered or unexported fields
}

MessageQueueConfig is used to indicate how the messaging provider should be configured.

type QueuesConfig

type QueuesConfig struct {
	DataChangesTopicName              string `env:"DATA_CHANGES_TOPIC_NAME"               json:"dataChangesTopicName"`
	OutboundEmailsTopicName           string `env:"OUTBOUND_EMAILS_TOPIC_NAME"            json:"outboundEmailsTopicName"`
	SearchIndexRequestsTopicName      string `env:"SEARCH_INDEX_REQUESTS_TOPIC_NAME"      json:"searchIndexRequestsTopicName"`
	MobileNotificationsTopicName      string `env:"MOBILE_NOTIFICATIONS_TOPIC_NAME"       json:"mobileNotificationsTopicName"`
	UserDataAggregationTopicName      string `env:"USER_DATA_AGGREGATION_TOPIC_NAME"      json:"userDataAggregationTopicName"`
	WebhookExecutionRequestsTopicName string `env:"WEBHOOK_EXECUTION_REQUESTS_TOPIC_NAME" json:"webhookExecutionRequestsTopicName"`
	// contains filtered or unexported fields
}

QueuesConfig contains the various queue names.

func (*QueuesConfig) ValidateWithContext

func (c *QueuesConfig) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a QueuesConfig struct.

Jump to

Keyboard shortcuts

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