Documentation
¶
Index ¶
- func MergeConfiguration(base, override Configuration) map[string]any
- func MergeRawConfigurationFiles(schemaLocationRebaseReference string, configFilePaths []string) ([]byte, error)
- func TruncateConfiguration(config Configuration, paths ...string) (map[string]any, error)
- type Configuration
- type MissingKeyError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeConfiguration ¶
func MergeConfiguration(base, override Configuration) map[string]any
MergeConfiguration returns a new configuration holding keys from base, unless they have been overridden. This function does not mutate its inputs, but returns a `map[string]any` instead of `types.Configuration`, so if your consumer is sensitive to the distinction, remember to cast the output.
func MergeRawConfigurationFiles ¶
func MergeRawConfigurationFiles(schemaLocationRebaseReference string, configFilePaths []string) ([]byte, error)
MergeRawConfigurationFiles merges multiple configuration files into a single configuration while rebasing the schema path to the proposed schemaLocationRebaseReference. The function is able to handle raw configuration files with Go template placeholders.
func TruncateConfiguration ¶
func TruncateConfiguration(config Configuration, paths ...string) (map[string]any, error)
TruncateConfiguration returns a new configuration with specified paths excluded from the base configuration. Paths use dot notation (e.g., "database.host", "api.endpoints.users"). Returns an error if config is nil, no paths are provided, or if any path is invalid.
Types ¶
type Configuration ¶
Configuration is the top-level container for all values for all services. See an example at: https://github.com/Azure/ARO-HCP/blob/main/config/config.yaml
func (*Configuration) UnmarshalJSON ¶
func (c *Configuration) UnmarshalJSON(data []byte) error
UnmarshalJSON overrides the default JSON unmarshaling to preserve integer precision. Without it, all numbers become float64 and values >= 1e6 render as scientific notation in Go templates (e.g. "2e+06").
type MissingKeyError ¶
func (MissingKeyError) Error ¶
func (e MissingKeyError) Error() string