Documentation
¶
Overview ¶
Package configuration provides configuration reading capabilities.
Index ¶
Constants ¶
const ( // AgentName is a short-hand name of the agent. AgentName = `sapagent` // AgentVersion is the version of the agent. AgentVersion = `1.6` // LinuxConfigPath is the default path to agent configuration file on linux. LinuxConfigPath = `/etc/google-cloud-sap-agent/configuration.json` // WindowsConfigPath is the default path to agent configuration file on linux. WindowsConfigPath = `C:\Program Files\Google\google-cloud-sap-agent\conf\configuration.json` )
Variables ¶
var DefaultCollectionDefinition []byte
DefaultCollectionDefinition embeds the contents of the file located at:
Functions ¶
func ApplyDefaults ¶
func ApplyDefaults(configFromFile *cpb.Configuration, cloudProps *iipb.CloudProperties) *cpb.Configuration
ApplyDefaults will apply the default configuration settings to the configuration passed. The defaults are set only if the values passed are UNDEFINED or invalid.
func ReadFromFile ¶
func ReadFromFile(path string, read ReadConfigFile) *cpb.Configuration
ReadFromFile reads configuration from given file into proto.
func ValidateQueries ¶
ValidateQueries is responsible for making sure that the custom queries have the correct metric and value type for the columns. In case of invalid combination it returns false. Query names and column names within each query must be unique as they are both used to path the metric URL to cloud monitoring.
Types ¶
type ReadConfigFile ¶
ReadConfigFile abstracts os.ReadFile function for testability.