config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const KafkaSecProtocolTLS = "TLS"

KafkaSecProtocolTLS informs service to use TLS protocol for kafka

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BindAddress             string        `envconfig:"BIND_ADDR"`
	DatasetAPIURL           string        `envconfig:"DATASET_API_URL"`
	DatasetAPIAuthToken     string        `envconfig:"DATASET_API_AUTH_TOKEN"     json:"-"`
	CacheSize               int           `envconfig:"CACHE_SIZE"`
	CacheExpiry             int           `envconfig:"CACHE_EXPIRY"`
	GracefulShutdownTimeout time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT"`
	ServiceAuthToken        string        `envconfig:"SERVICE_AUTH_TOKEN"         json:"-"`
	ZebedeeURL              string        `envconfig:"ZEBEDEE_URL"`
	ReportEventTopic        string        `envconfig:"CONSUMER_TOPIC"`
	ReportEventGroup        string        `envconfig:"CONSUMER_GROUP"`
	KafkaBrokers            []string      `envconfig:"KAFKA_ADDR"`
	KafkaVersion            string        `envconfig:"KAFKA_VERSION"`
	KafkaSecProtocol        string        `envconfig:"KAFKA_SEC_PROTO"`
	KafkaSecCACerts         string        `envconfig:"KAFKA_SEC_CA_CERTS"`
	KafkaSecClientCert      string        `envconfig:"KAFKA_SEC_CLIENT_CERT"`
	KafkaSecClientKey       string        `envconfig:"KAFKA_SEC_CLIENT_KEY"       json:"-"`
	KafkaSecSkipVerify      bool          `envconfig:"KAFKA_SEC_SKIP_VERIFY"`
	KafkaOffsetOldest       bool          `envconfig:"KAFKA_OFFSET_OLDEST"`
}

Config struct to hold application configuration.

func Get

func Get() (*Config, error)

Get configures the application and returns the configuration

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.

Jump to

Keyboard shortcuts

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