config

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	BindAddr                   string        `envconfig:"BIND_ADDR"`
	Host                       string        `envconfig:"HOST"`
	Brokers                    []string      `envconfig:"KAFKA_ADDR"`
	DatabakerImportTopic       string        `envconfig:"DATABAKER_IMPORT_TOPIC"`
	InputFileAvailableTopic    string        `envconfig:"INPUT_FILE_AVAILABLE_TOPIC"`
	KafkaMaxBytes              int           `envconfig:"KAFKA_MAX_BYTES"`
	ServiceAuthToken           string        `envconfig:"SERVICE_AUTH_TOKEN"          json:"-"`
	MongoDBURL                 string        `envconfig:"MONGODB_IMPORTS_ADDR"        json:"-"`
	MongoDBCollection          string        `envconfig:"MONGODB_IMPORTS_COLLECTION"`
	MongoDBDatabase            string        `envconfig:"MONGODB_IMPORTS_DATABASE"`
	DatasetAPIURL              string        `envconfig:"DATASET_API_URL"`
	RecipeAPIURL               string        `envconfig:"RECIPE_API_URL"`
	GracefulShutdownTimeout    time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT"`
	ZebedeeURL                 string        `envconfig:"ZEBEDEE_URL"`
	HealthCheckInterval        time.Duration `envconfig:"HEALTHCHECK_INTERVAL"`
	HealthCheckCriticalTimeout time.Duration `envconfig:"HEALTHCHECK_CRITICAL_TIMEOUT"`
	DefaultLimit               int           `envconfig:"DEFAULT_LIMIT"`
	DefaultMaxLimit            int           `envconfig:"DEFAULT_MAXIMUM_LIMIT"`
	DefaultOffset              int           `envconfig:"DEFAULT_OFFSET"`
}

Configuration structure which hold information for configuring the import API

func Get

func Get() (*Configuration, error)

Get the application and returns the configuration structure

func (Configuration) String

func (config Configuration) 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