types

package
v0.0.0-...-da51959 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 10 Imported by: 8

Documentation

Index

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

type Configuration map[string]any

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) GetByPath

func (v Configuration) GetByPath(path string) (any, error)

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

type MissingKeyError struct {
	Path string
	Key  string
}

func (MissingKeyError) Error

func (e MissingKeyError) Error() string

Jump to

Keyboard shortcuts

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