Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureLogging ¶
func ConfigureLogging(config *LoggingConfig) (*logrus.Entry, error)
ConfigureLogging configures the default logger
Types ¶
type CacheConfiguration ¶
type CacheConfiguration struct { NumCounters int64 `json:"num_counters" envconfig:"CACHE_NUM_COUNTERS"` MaxCosts int64 `json:"max_costs" envconfig:"CACHE_MAX_COSTS"` BufferItems int64 `json:"buffer_items" envconfig:"CACHE_BUFFER_ITEMS"` Metrics bool `json:"metrics" envconfig:"CACHE_METRICS"` }
CacheConfiguration maps config for ristretto cache
type Configuration ¶
type Configuration struct { Logging LoggingConfig `json:"log"` DB DBConfiguration `json:"db"` OpenWeather OpenWeatherConfiguration `json:"open_weather"` Web WebConfiguration `json:"web"` Cache CacheConfiguration `json:"cache"` }
Configuration holds information about our current application-instance the config data SHOULD be loaded from environment variables
func LoadConfig ¶
func LoadConfig(filename string) (*Configuration, error)
LoadConfig loads the Configuration from env
type DBConfiguration ¶
type DBConfiguration struct { Driver string `json:"driver" required:"true" envconfig:"DATABASE_DRIVER"` URL string `json:"url" envconfig:"DATABASE_URL" required:"true"` Namespace string `json:"namespace" envconfig:"DATABASE_NAMESPACE"` }
DBConfiguration connection params for our Database
type LoggingConfig ¶
type LoggingConfig struct { Level string `mapstructure:"log_level" json:"log_level" envconfig:"LOG_LEVEL"` File string `mapstructure:"log_file" json:"log_file" envconfig:"LOG_FILE"` DisableColors bool `mapstructure:"disable_colors" split_words:"true" json:"disable_colors" envconfig:"LOG_DISABLE_COLORS"` QuoteEmptyFields bool `mapstructure:"quote_empty_fields" split_words:"true" json:"quote_empty_fields" envconfig:"LOG_QUOTE_EMPTY_FIELDS"` TSFormat string `mapstructure:"ts_format" json:"ts_format"` Fields map[string]interface{} `mapstructure:"fields" json:"fields"` }
LoggingConfig keeps logrus Configuration
type OpenWeatherConfiguration ¶
type OpenWeatherConfiguration struct { APIKEY string `json:"api_key" required:"true" envconfig:"OPENWEATHER_API_KEY"` CityListEndpoint string `json:"city_list_endpoint" envconfig:"OPENWEATHER_CITYLIST_ENDPOINT"` Fallback bool `json:"fallback" envconfig:"OPENWEATHER_FALLBACK"` }
OpenWeatherConfiguration keeps track of openweather informations
Click to show internal directories.
Click to hide internal directories.