config

package
v0.0.0-...-94024fc Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(logger zerolog.Logger)

Init initializes the configuration and starts watching for changes.

Types

type Config

type Config struct {
	Server ServerConfig `mapstructure:"server"`
	Kafka  KafkaConfig  `mapstructure:"kafka"`
}

func GetConfig

func GetConfig() Config

GetConfig returns a copy of the current configuration. This makes it safe to use in concurrent operations and makes it impossible to modify the configuration from outside the package.

type KafkaConfig

type KafkaConfig struct {
	BootstrapServers string              `mapstructure:"bootstrap-servers"`
	MaxRetries       int                 `mapstructure:"max-retries"`
	ProducerConfig   KafkaProducerConfig `mapstructure:"producer"`
	ConsumerConfig   KafkaConsumerConfig `mapstructure:"consumer"`
}

type KafkaConsumerConfig

type KafkaConsumerConfig struct {
	EmailTopic           string `mapstructure:"email-topic"`
	MessageChannelBuffer int    `mapstructure:"message-channel-buffer"`
	AutoCommitInterval   int    `mapstructure:"auto-commit-interval"`
	WorkerPool           int    `mapstructure:"worker-pool"`
	GroupID              string `mapstructure:"group-id"`
	DeadLetterTopic      string `mapstructure:"dead-letter-topic"`
}

type KafkaProducerConfig

type KafkaProducerConfig struct {
	BootstrapServers     string `mapstructure:"bootstrap-servers"`
	RequiredAcks         int    `mapstructure:"required-acks"`
	MessageChannelBuffer int    `mapstructure:"message-channel-buffer"`
	WorkerPool           int    `mapstructure:"worker-pool"`
	BatchSize            int    `mapstructure:"batch-size"`
	BatchTimeoutMs       int    `mapstructure:"batch-timeout-ms"`
}

type ServerConfig

type ServerConfig struct {
	Port string
}

Jump to

Keyboard shortcuts

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