Documentation
¶
Overview ¶
Package value defines the Value interface, the primary abstraction for reading configuration values in go-config.
Key Types ¶
- Value — the central interface with two methods:
- Get(dest any) error — extracts and type-converts the internal value into dest (passed by pointer), similar to encoding/json.Unmarshal.
- Meta() meta.Info — returns metadata about the value: its key path, source info, and revision.
Implementation ¶
This package only defines the contract. The concrete implementation lives in the [tree] package ([tree.NewValue]).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Value ¶
type Value interface {
// Get is the main method for data extraction. It attempts
// to convert and write the internal value into the variable `dest`,
// passed by pointer. The type conversion logic is similar
// to standard libraries such as `json.Unmarshal`.
Get(dest any) error
// Meta returns metadata (source name, revision) for this
// particular value.
Meta() meta.Info
}
Value represents a single value in the configuration.
Click to show internal directories.
Click to hide internal directories.