config

package
v1.18.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: 7 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"`
	ServiceAuthToken           string        `envconfig:"SERVICE_AUTH_TOKEN"            json:"-"`
	DatasetAPIAddr             string        `envconfig:"DATASET_API_ADDR"`
	DatasetAPIMaxWorkers       int           `envconfig:"DATASET_API_MAX_WORKERS"` // maximum number of concurrent go-routines requesting items to datast api at the same time
	DatasetAPIBatchSize        int           `envconfig:"DATASET_API_BATCH_SIZE"`  // maximum size of a response by dataset api when requesting items in batches
	GracefulShutdownTimeout    time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT"`
	HealthCheckInterval        time.Duration `envconfig:"HEALTHCHECK_INTERVAL"`
	HealthCheckCriticalTimeout time.Duration `envconfig:"HEALTHCHECK_CRITICAL_TIMEOUT"`
	EnablePatchNodeID          bool          `envconfig:"ENABLE_PATCH_NODE_ID"`
	KafkaConfig                KafkaConfig
}

Config struct to hold application configuration.

func Get

func Get(ctx context.Context) (*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.

type KafkaConfig added in v1.13.0

type KafkaConfig struct {
	Brokers                        []string `envconfig:"KAFKA_ADDR"                           json:"-"`
	BatchSize                      int      `envconfig:"BATCH_SIZE"`        // number of kafka messages that will be batched
	NumWorkers                     int      `envconfig:"KAFKA_NUM_WORKERS"` // maximum number of concurent kafka messages being consumed at the same time
	Version                        string   `envconfig:"KAFKA_VERSION"`
	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"`
	IncomingInstancesTopic         string   `envconfig:"DIMENSIONS_EXTRACTED_TOPIC"`
	IncomingInstancesConsumerGroup string   `envconfig:"DIMENSIONS_EXTRACTED_CONSUMER_GROUP"`
	OutgoingInstancesTopic         string   `envconfig:"DIMENSIONS_INSERTED_TOPIC"`
	EventReporterTopic             string   `envconfig:"EVENT_REPORTER_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