value

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: BSD-2-Clause Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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