config

package
v1.13.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: 6 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"`
	DatasetAPIURL              string        `envconfig:"DATASET_API_URL"`
	CacheTTL                   time.Duration `envconfig:"CACHE_TTL"`
	GracefulShutdownTimeout    time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT"`
	ServiceAuthToken           string        `envconfig:"SERVICE_AUTH_TOKEN"             json:"-"`
	HealthCheckInterval        time.Duration `envconfig:"HEALTHCHECK_INTERVAL"`
	HealthCheckCriticalTimeout time.Duration `envconfig:"HEALTHCHECK_CRITICAL_TIMEOUT"`
	GraphDriverChoice          string        `envconfig:"GRAPH_DRIVER_TYPE"`
	EnableGetGraphDimensionID  bool          `envconfig:"ENABLE_GET_GRAPH_DIMENSION_ID"`
	KafkaConfig                KafkaConfig
}

Config values for the application

func Get

func Get(ctx context.Context) (*Config, error)

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

type KafkaConfig added in v1.9.0

type KafkaConfig struct {
	Brokers                  []string      `envconfig:"KAFKA_ADDR"                  json:"-"`
	Version                  string        `envconfig:"KAFKA_VERSION"`
	BatchSize                int           `envconfig:"BATCH_SIZE"` // number of kafka messages that will be batched
	BatchWaitTime            time.Duration `envconfig:"BATCH_WAIT_TIME"`
	MaxBytes                 int           `envconfig:"KAFKA_MAX_BYTES"`
	OffsetOldest             bool          `envconfig:"KAFKA_OFFSET_OLDEST"`
	SecProtocol              string        `envconfig:"KAFKA_SEC_PROTO"`
	SecClientKey             string        `envconfig:"KAFKA_SEC_CLIENT_KEY"        json:"-"`
	SecClientCert            string        `envconfig:"KAFKA_SEC_CLIENT_CERT"`
	SecCACerts               string        `envconfig:"KAFKA_SEC_CA_CERTS"`
	SecSkipVerify            bool          `envconfig:"KAFKA_SEC_SKIP_VERIFY"`
	ObservationConsumerGroup string        `envconfig:"OBSERVATION_CONSUMER_GROUP"`
	ObservationConsumerTopic string        `envconfig:"OBSERVATION_CONSUMER_TOPIC"`
	ErrorProducerTopic       string        `envconfig:"ERROR_PRODUCER_TOPIC"`
	ResultProducerTopic      string        `envconfig:"RESULT_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