config

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const KafkaTLSProtocolFlag = "TLS"

KafkaTLSProtocolFlag informs service to use TLS protocol for kafka

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BindAddr                string        `envconfig:"BIND_ADDR"`
	AWSRegion               string        `envconfig:"AWS_REGION"`
	BucketNames             []string      `envconfig:"BUCKET_NAMES"                   json:"-"`
	LocalstackHost          string        `envconfig:"LOCALSTACK_HOST"`
	EncryptionDisabled      bool          `envconfig:"ENCRYPTION_DISABLED"`
	GracefulShutdownTimeout time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT"`
	HealthCheckInterval     time.Duration `envconfig:"HEALTHCHECK_INTERVAL"`
	HealthCriticalTimeout   time.Duration `envconfig:"HEALTHCHECK_CRITICAL_TIMEOUT"`
	KafkaConfig             KafkaConfig
	VaultAddr               string `envconfig:"VAULT_ADDR"`
	VaultToken              string `envconfig:"VAULT_TOKEN"                           json:"-"`
	VaultPath               string `envconfig:"VAULT_PATH"`
}

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.8.0

type KafkaConfig struct {
	Brokers                  []string `envconfig:"KAFKA_ADDR"                         json:"-"`
	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"`
	ErrorProducerTopic       string   `envconfig:"ERROR_PRODUCER_TOPIC"`
	FileConsumerGroup        string   `envconfig:"FILE_CONSUMER_GROUP"`
	FileConsumerTopic        string   `envconfig:"FILE_CONSUMER_TOPIC"`
	ObservationProducerTopic string   `envconfig:"OBSERVATION_PRODUCER_TOPIC"`
}

KafkaConfig contains the config required to connect to Kafka

Jump to

Keyboard shortcuts

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