values

package
v0.32.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage holds example values synthesized from a package's OpenAPI settings and values schemas. Both maps are produced once at construction by defaults.Generate; the accessors are pure getters that return the cached instances.

Either map may be nil if the corresponding schema file was missing. The returned maps are shared references — callers must not mutate them.

func LoadStorage

func LoadStorage(path string) (*Storage, error)

LoadStorage loads the OpenAPI schemas from path/openapi (settings.yaml or the legacy config-values.yaml, plus values.yaml), compiles them, and synthesizes an example map from each. The synthesized maps are served unchanged by GetSettings and GetValues.

Missing schema files are tolerated: the corresponding example map will be nil.

Returns an error if a schema file is unreadable, schema compilation fails, or example synthesis fails.

func (*Storage) GetSettings

func (s *Storage) GetSettings() map[string]any

GetSettings returns the example settings synthesized from the settings schema, or nil if no settings schema was present. The returned map is the cached instance — do not mutate.

func (*Storage) GetValues

func (s *Storage) GetValues() map[string]any

GetValues returns the example values synthesized from the values schema, or nil if no values schema was present. The returned map is the cached instance — do not mutate.

Directories

Path Synopsis
defaults
Package defaults synthesizes an example value map from an OpenAPI schema.
Package defaults synthesizes an example value map from an OpenAPI schema.
reggen
Package reggen produces example strings that match a Perl-flavored regular expression.
Package reggen produces example strings that match a Perl-flavored regular expression.

Jump to

Keyboard shortcuts

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