Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetConfigProvider ¶
func SetConfigProvider(provider ConfigProvider)
SetConfigProvider sets the global configuration provider. This is useful for injecting custom configurations during tests.
Types ¶
type AMQPConfig ¶
type AMQPConfig struct { Url string `env:"URL" validate:"required"` Exchange string `env:"EXCHANGE" envDefault:"paota_task_exchange"` ExchangeType string `env:"EXCHANGE_TYPE" envDefault:"direct"` QueueDeclareArgs QueueDeclareArgs `env:"QUEUE_DECLARE_ARGS"` QueueBindingArgs QueueBindingArgs `env:"QUEUE_BINDING_ARGS"` BindingKey string `env:"BINDING_KEY" envDefault:"paota_task_binding_key"` PrefetchCount int `env:"PREFETCH_COUNT" validate:"required"` AutoDelete bool `env:"AUTO_DELETE"` DelayedQueue string `env:"DELAYED_QUEUE" envDefault:"paota_task_delayed_queue"` ConnectionPoolSize int `env:"CONNECTION_POOL_SIZE" envDefault:"5"` HeartBeatInterval int `env:"HEARTBEAT_INTERVAL" envDefault:"10"` }
AMQPConfig wraps RabbitMQ related configuration
type Config ¶
type Config struct { Broker string `env:"BROKER" envDefault:"amqp" validate:"required,oneof=amqp"` //allowed amqp Store string `env:"STORE"` TaskQueueName string `env:"QUEUE_NAME" envDefault:"paota_tasks" validate:"required"` StoreQueueName string `env:"STORE_QUEUE_NAME"` AMQP *AMQPConfig `envPrefix:"AMQP_"` MongoDB *MongoDBConfig `envPrefix:"MONGO_"` }
Config holds all configuration for Paota
type ConfigProvider ¶
type ConfigProvider interface { ReadFromEnv() error SetApplicationConfig(config Config) error ValidateConfig(cfg Config) error GetConfig() *Config }
ConfigProvider is an interface for retrieving configuration.
func GetConfigProvider ¶
func GetConfigProvider() ConfigProvider
GetConfigProvider returns the global configuration provider.
func NewConfigProvider ¶
func NewConfigProvider() ConfigProvider
NewConfigProvider creates a new instance of ConfigProvider.
type MongoDBConfig ¶
MongoDBConfig ...
type QueueBindingArgs ¶
type QueueBindingArgs map[string]interface{}
QueueBindingArgs arguments which are used when binding to the exchange
type QueueDeclareArgs ¶
type QueueDeclareArgs map[string]interface{}
QueueDeclareArgs arguments which are used when declaring a queue
Click to show internal directories.
Click to hide internal directories.