configuration

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package configuration provides configuration reading capabilities.

Index

Constants

View Source
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

View Source
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

func ValidateQueries(queries []*cpb.Query) bool

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

type ReadConfigFile func(string) ([]byte, error)

ReadConfigFile abstracts os.ReadFile function for testability.

type WriteConfigFile

type WriteConfigFile func(string, []byte, os.FileMode) error

WriteConfigFile abstracts os.WriteFile function for testability.

Jump to

Keyboard shortcuts

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