config

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const KafkaTLSProtocolFlag = "TLS"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BindAddr                   string `envconfig:"BIND_ADDR"`
	KafkaConfig                KafkaConfig
	FilterAPIURL               string        `envconfig:"FILTER_API_URL"`
	AWSRegion                  string        `envconfig:"AWS_REGION"`
	S3BucketName               string        `envconfig:"S3_BUCKET_NAME"`
	S3BucketURL                string        `envconfig:"S3_BUCKET_URL"`
	S3PrivateBucketName        string        `envconfig:"S3_PRIVATE_BUCKET_NAME"`
	DatasetAPIURL              string        `envconfig:"DATASET_API_URL"`
	ErrorProducerTopic         string        `envconfig:"ERROR_PRODUCER_TOPIC"`
	GracefulShutdownTimeout    time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT"`
	HealthCheckInterval        time.Duration `envconfig:"HEALTHCHECK_INTERVAL"`
	HealthCheckCriticalTimeout time.Duration `envconfig:"HEALTHCHECK_CRITICAL_TIMEOUT"`
	DownloadServiceURL         string        `envconfig:"DOWNLOAD_SERVICE_URL"`
	APIDomainURL               string        `envconfig:"API_DOMAIN_URL"`
	ServiceAuthToken           string        `envconfig:"SERVICE_AUTH_TOKEN"            json:"-"`
	StartupTimeout             time.Duration `envconfig:"STARTUP_TIMEOUT"`
	ZebedeeURL                 string        `envconfig:"ZEBEDEE_URL"`
	FullDatasetFilePrefix      string        `envconfig:"FULL_DATASET_FILE_PREFIX"`
	FilteredDatasetFilePrefix  string        `envconfig:"FILTERED_DATASET_FILE_PREFIX"`
	OTExporterOTLPEndpoint     string        `envconfig:"OTEL_EXPORTER_OTLP_ENDPOINT"`
	OTServiceName              string        `envconfig:"OTEL_SERVICE_NAME"`
	OTBatchTimeout             time.Duration `envconfig:"OTEL_BATCH_TIMEOUT"`
	OtelEnabled                bool          `envconfig:"OTEL_ENABLED"`
	LocalstackHost             string        `envconfig:"LOCALSTACK_HOST"`
}

Config values for the application.

func Get

func Get() (*Config, error)

Get the configuration values from the environment or provide the defaults.

func (Config) String

func (config Config) String() string

String is implemented to prevent sensitive fields being logged. The config is returned as JSON with sensitive fields omitted.

type KafkaConfig added in v1.25.0

type KafkaConfig struct {
	Brokers                   []string `envconfig:"KAFKA_ADDR"`
	Version                   string   `envconfig:"KAFKA_VERSION"`
	OffsetOldest              bool     `envconfig:"KAFKA_OFFSET_OLDEST"`
	SecProtocol               string   `envconfig:"KAFKA_SEC_PROTO"`
	SecCACerts                string   `envconfig:"KAFKA_SEC_CA_CERTS"`
	SecClientKey              string   `envconfig:"KAFKA_SEC_CLIENT_KEY"    json:"-"`
	SecClientCert             string   `envconfig:"KAFKA_SEC_CLIENT_CERT"`
	SecSkipVerify             bool     `envconfig:"KAFKA_SEC_SKIP_VERIFY"`
	NumWorkers                int      `envconfig:"KAFKA_NUM_WORKERS"`
	FilterConsumerGroup       string   `envconfig:"HELLO_CALLED_GROUP"`
	FilterConsumerTopic       string   `envconfig:"HELLO_CALLED_TOPIC"`
	CSVExportedProducerTopic  string   `envconfig:"CSV_EXPORTED_PRODUCER_TOPIC"`
	ConsumerMinBrokersHealthy int      `envconfig:"KAFKA_CONSUMER_MIN_BROKERS_HEALTHY"`
	MaxBytes                  int      `envconfig:"KAFKA_MAX_BYTES"`
	ProducerMinBrokersHealthy int      `envconfig:"KAFKA_PRODUCER_MIN_BROKERS_HEALTHY"`
}

Jump to

Keyboard shortcuts

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