value

package
v0.66.0 Latest Latest
Warning

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

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

Documentation

Overview

Package value supports values files and validation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidFileExtError

type InvalidFileExtError struct {
	FilePath string
	Ext      string
}

InvalidFileExtError represents an error when a file has an invalid extension

func (*InvalidFileExtError) Error

func (e *InvalidFileExtError) Error() string

type ParseFilesOptions

type ParseFilesOptions struct {
}

ParseFilesOptions provides optional configuration for ParseFiles

type Path

type Path string

Path starts with a . and represents a specific key in a nested hierarchy of keys. For example, .resources.limits.cpu resolves the value for "cpu" within the keyspace of Values.

func (Path) Validate

func (p Path) Validate() error

Validate inspects the string stored at Path and ensures it's valid.

type Values

type Values map[string]any

Values provides a map of keys to values for use in templating and Helm overrides. NOTE(mkcp): Values is NOT thread-safe. If you need concurrent access:

  • Use external synchronization (sync.RWMutex)
  • Clone before passing to goroutines

func ParseFiles

func ParseFiles(ctx context.Context, paths []string, _ ParseFilesOptions) (_ Values, err error)

ParseFiles parses the given files in order, overwriting previous values with later values, and returns a merged Values map.

func (Values) DeepMerge

func (v Values) DeepMerge(sources ...Values)

DeepMerge merges one or more Values maps recursively into the receiver via mutation. Later maps in the variadic arguments take precedence over earlier ones.

func (Values) Extract

func (v Values) Extract(path Path) (any, error)

Extract retrieves a value from a nested Values map using dot notation path. Path format: ".key.subkey.value" where each dot represents a map level.

func (Values) Set

func (v Values) Set(path Path, newVal any) error

Set takes a Values, a Path to a new or existing key, and any value and stores the newVal at the path. Special case: path "." merges the newVal's map contents directly into v (at the root).

type YAMLDecodeError

type YAMLDecodeError struct {
	FilePath string
	Err      error
}

YAMLDecodeError represents an error when YAML parsing fails

func (*YAMLDecodeError) Error

func (e *YAMLDecodeError) Error() string

func (*YAMLDecodeError) Unwrap

func (e *YAMLDecodeError) Unwrap() error

Jump to

Keyboard shortcuts

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