Discover Packages
darvaza.org/x/config
package
module
Version:
v0.2.10
Opens a new window with list of versions in this module.
Published: Jan 26, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 7
Opens a new window with list of known importers.
README
README
¶
Darvaza Config
darvaza.org/x/config
provides helpers
for dealing with config files.
Default values
Wrappers for github.com/amery/defaults
:
SetDefaults()
Set()
CanUpdate()
Environment
Expand shell-style variables:
FromString()
FromBytes()
FromReader()
FromFile()
Validations
Wrappers for github.com/go-playground/validator/v10
:
Validate()
AsValidationError()
and Prepare()
. calling SetDefaults()
and Validate()
.
See also
Expand ▾
Collapse ▴
Documentation
¶
Package config provides helpers for handling
config structs
CanUpdate returns true when the given value is an initial value of its type
Prepare runs SetDefaults and Validate
Set applies `default` struct-tags and SetDefaults()
recursively. If the given object has a `SetDefaults() error`
method, it will be ignored. Any `SetDefaults() error` deeper
in the struct will be called.
SetDefaults applies `default` struct-tags and SetDefaults()
recursively. If the given object has a `SetDefaults() error`
method, it will be invoked instead.
Validate validates exposed fields including nested structs
Source Files
¶
Directories
¶
Package expand implements helpers to expand shell-style variables within config files before they are parsed
Package expand implements helpers to expand shell-style variables within config files before they are parsed
Click to show internal directories.
Click to hide internal directories.