configuration

package
v0.10.18 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidConfig = errors.New("invalid configuration")
)

Functions

func Apply

func Apply(gs *goschtalt.Config, name string, required bool, opts ...goschtalt.ExpandOption) error

Apply applies the external configurations defined to the goschtalt configuration system.

Types

type External

type External struct {
	// Required determines if the external configuration file is required.  If
	// the file is required and cannot be found, the program will exit with an
	// error.
	Required bool

	// File is the path to the external configuration file based on the root path.
	File string

	// As is the alternate file extension to use when decoding the file.  If empty,
	// the file extension is used (like normal).
	As string

	// Origin is the origin of the external configuration file.  This is used in
	// by the configuration system to express where the configuration came from.
	Origin string

	// Remap is an array of from/to mappings that are used to remap the keys in the
	// external configuration file to the keys in the internal configuration map.
	Remap []Remap
	// contains filtered or unexported fields
}

External represents an external configuration file that is used to populate a map of string values.

type Remap

type Remap struct {
	// From is the key in the external configuration file.
	From string

	// To is the key in the internal configuration map.
	To string

	// Optional determines if the key is optional.  If the key is optional and cannot
	// be found in the external configuration file, the key is not added to the internal
	// configuration map.  If the key is not optional and cannot be found, the program
	// will exit with an error.
	Optional bool
}

Remap represents a key remapping from the external configuration file to the internal configuration map.

Jump to

Keyboard shortcuts

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