conf

package
v0.0.0-...-a7cb739 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package conf contains definition of data type named ConfigStruct that represents configuration of the mock 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 two specific functions named GetServerConfiguration and GetGroupsConfiguration are to be used to return specific configuration options.

Generated documentation is available at: https://godoc.org/github.com/RedHatInsights/insights-results-aggregator-mock/conf

Documentation in literate-programming-style is available at: https://redhatinsights.github.io/insights-results-aggregator-mock/packages/conf/configuration.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContentConfiguration

func GetContentConfiguration() content.Configuration

GetContentConfiguration returns groups configuration

func GetGroupsConfiguration

func GetGroupsConfiguration() groups.Configuration

GetGroupsConfiguration returns groups configuration

func GetServerConfiguration

func GetServerConfiguration() server.Configuration

GetServerConfiguration returns server configuration

Types

type ConfigStruct

type ConfigStruct struct {
	Server  server.Configuration  `mapstructure:"server" toml:"server"`
	Content content.Configuration `mapstructure:"content" toml:"content"`
	Groups  groups.Configuration  `mapstructure:"groups" toml:"groups"`
	Paths   PathsConfiguration    `mapstructure:"paths" toml:"paths"`
}

ConfigStruct is a structure holding the whole service configuration

var Config ConfigStruct

Config has exactly the same structure as *.toml file

func LoadConfiguration

func LoadConfiguration(defaultConfigFile string) (ConfigStruct, error)

LoadConfiguration loads configuration from defaultConfigFile, file set in configFileEnvVariableName or from env

type PathsConfiguration

type PathsConfiguration struct {
	MockDataPath string `mapstructure:"mock_data" toml:"mock_data"`
}

PathsConfiguration is data structure that represents path to directory containing files with mock data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL