value

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: BSD-2-Clause Imports: 1 Imported by: 0

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.

Jump to

Keyboard shortcuts

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