Documentation ¶
Overview ¶
Package conf contains definition of data type named Config that represents configuration of Smart Proxy service. This package also contains function named LoadConfiguration that can be used to load configuration from provided configuration file and/or from environment variables. Additionally several specific functions named GetServerConfiguration, GetServicesConfiguration, GetSetupConfiguration, GetMetricsConfiguration, GetLoggingConfiguration and GetCloudWatchConfiguration are to be used to return specific configuration options.
Generated documentation is available at: https://godoc.org/github.com/RedHatInsights/insights-results-smart-proxy/conf
Documentation in literate-programming-style is available at: https://redhatinsights.github.io/insights-results-smart-proxy/packages/conf/configuration.html
Index ¶
- Variables
- func GetAMSClientConfiguration() amsclient.Configuration
- func GetCloudWatchConfiguration() logger.CloudWatchConfiguration
- func GetKafkaZerologConfiguration() logger.KafkaZerologConfiguration
- func GetLoggingConfiguration() logger.LoggingConfiguration
- func GetRedisConfiguration() services.RedisConfiguration
- func GetSentryLoggingConfiguration() logger.SentryLoggingConfiguration
- func GetServerConfiguration() server.Configuration
- func GetServicesConfiguration() services.Configuration
- func LoadConfiguration(defaultConfigFile string) error
- type MetricsConfiguration
- type SetupConfiguration
Constants ¶
This section is empty.
Variables ¶
var Config struct { ServerConf server.Configuration `mapstructure:"server" toml:"server"` ServicesConf services.Configuration `mapstructure:"services" toml:"services"` RedisConf services.RedisConfiguration `mapstructure:"redis" toml:"redis"` SetupConf SetupConfiguration `mapstructure:"setup" toml:"setup"` MetricsConf MetricsConfiguration `mapstructure:"metrics" toml:"metrics"` LoggingConf logger.LoggingConfiguration `mapstructure:"logging" toml:"logging"` CloudWatchConf logger.CloudWatchConfiguration `mapstructure:"cloudwatch" toml:"cloudwatch"` SentryLoggingConf logger.SentryLoggingConfiguration `mapstructure:"sentry" toml:"sentry"` KafkaZerologConf logger.KafkaZerologConfiguration `mapstructure:"kafka_zerolog" toml:"kafka_zerolog"` AMSClientConf amsclient.Configuration `mapstructure:"amsclient" toml:"amsclient"` }
Config has exactly the same structure as *.toml file
Functions ¶
func GetAMSClientConfiguration ¶
func GetAMSClientConfiguration() amsclient.Configuration
GetAMSClientConfiguration returns the amsclient configuration
func GetCloudWatchConfiguration ¶
func GetCloudWatchConfiguration() logger.CloudWatchConfiguration
GetCloudWatchConfiguration returns cloudwatch configuration
func GetKafkaZerologConfiguration ¶
func GetKafkaZerologConfiguration() logger.KafkaZerologConfiguration
GetKafkaZerologConfiguration returns the kafkazero log configuration
func GetLoggingConfiguration ¶
func GetLoggingConfiguration() logger.LoggingConfiguration
GetLoggingConfiguration returns logging configuration
func GetRedisConfiguration ¶
func GetRedisConfiguration() services.RedisConfiguration
GetRedisConfiguration returns Redis configuration
func GetSentryLoggingConfiguration ¶
func GetSentryLoggingConfiguration() logger.SentryLoggingConfiguration
GetSentryLoggingConfiguration returns sentry logging configuration
func GetServerConfiguration ¶
func GetServerConfiguration() server.Configuration
GetServerConfiguration returns server configuration
func GetServicesConfiguration ¶
func GetServicesConfiguration() services.Configuration
GetServicesConfiguration returns the services endpoints configuration
func LoadConfiguration ¶
LoadConfiguration loads configuration from defaultConfigFile, file set in configFileEnvVariableName or from env
Types ¶
type MetricsConfiguration ¶
type MetricsConfiguration struct {
Namespace string `mapstructure:"namespace" toml:"namespace"`
}
MetricsConfiguration defines configuration for metrics
func GetMetricsConfiguration ¶
func GetMetricsConfiguration() MetricsConfiguration
GetMetricsConfiguration returns the metrics configuration
type SetupConfiguration ¶
type SetupConfiguration struct {
InternalRulesOrganizationsCSVFile string `mapstructure:"internal_rules_organizations_csv_file" toml:"internal_rules_organizations_csv_file"`
}
SetupConfiguration should only be used at startup
func GetSetupConfiguration ¶
func GetSetupConfiguration() SetupConfiguration
GetSetupConfiguration returns the setup configuration only to be used at startup