Documentation ¶
Overview ¶
Package conf contains definition of data type named ConfigStruct that represents configuration of Content 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, GetGroupsConfiguration, GetContentPathConfiguration, 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-content-service/conf
Documentation in literate-programming-style is available at: https://redhatinsights.github.io/insights-content-service/packages/conf/configuration.html
Index ¶
- func GetCloudWatchConfiguration() logger.CloudWatchConfiguration
- func GetContentPathConfiguration() string
- func GetGroupsConfiguration() groups.Configuration
- func GetKafkaZerologConfiguration() logger.KafkaZerologConfiguration
- func GetLoggingConfiguration() logger.LoggingConfiguration
- func GetSentryLoggingConfiguration() logger.SentryLoggingConfiguration
- func GetServerConfiguration() server.Configuration
- func LoadConfiguration(defaultConfigFile string) error
- type ConfigStruct
- type MetricsConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCloudWatchConfiguration ¶
func GetCloudWatchConfiguration() logger.CloudWatchConfiguration
GetCloudWatchConfiguration returns cloudwatch configuration
func GetContentPathConfiguration ¶
func GetContentPathConfiguration() string
GetContentPathConfiguration get the path to the content files from the configuration
func GetGroupsConfiguration ¶
func GetGroupsConfiguration() groups.Configuration
GetGroupsConfiguration returns groups configuration
func GetKafkaZerologConfiguration ¶
func GetKafkaZerologConfiguration() logger.KafkaZerologConfiguration
GetKafkaZerologConfiguration returns the kafkazero log configuration
func GetLoggingConfiguration ¶
func GetLoggingConfiguration() logger.LoggingConfiguration
GetLoggingConfiguration returns logging configuration
func GetSentryLoggingConfiguration ¶
func GetSentryLoggingConfiguration() logger.SentryLoggingConfiguration
GetSentryLoggingConfiguration returns the sentry log configuration
func GetServerConfiguration ¶
func GetServerConfiguration() server.Configuration
GetServerConfiguration returns server configuration
func LoadConfiguration ¶
LoadConfiguration loads configuration from defaultConfigFile, file set in configFileEnvVariableName or from env
Types ¶
type ConfigStruct ¶
type ConfigStruct struct { Server server.Configuration `mapstructure:"server" toml:"server"` Groups groups.Configuration `mapstructure:"groups" toml:"groups"` Content struct { ContentPath string `mapstructure:"path" toml:"path"` } `mapstructure:"content" toml:"content"` Metrics MetricsConf `mapstructure:"metrics" toml:"metrics"` Logging logger.LoggingConfiguration `mapstructure:"logging" toml:"logging"` CloudWatch logger.CloudWatchConfiguration `mapstructure:"cloudwatch" toml:"cloudwatch"` SentryLoggingConf logger.SentryLoggingConfiguration `mapstructure:"sentry" toml:"sentry"` KafkaZerologConf logger.KafkaZerologConfiguration `mapstructure:"kafka_zerolog" toml:"kafka_zerolog"` }
ConfigStruct is a structure holding the whole service configuration
var Config ConfigStruct
Config has exactly the same structure as *.toml file
type MetricsConf ¶
type MetricsConf struct {
Namespace string `mapstructure:"namespace" toml:"namespace"`
}
MetricsConf contains the metrics configuration
func GetMetricsConfiguration ¶
func GetMetricsConfiguration() MetricsConf
GetMetricsConfiguration get MetricsConf from the loaded configuration