Categorygithub.com/twipi/cfgutil
modulepackage
0.0.0-20240507030022-1c27be464a19
Repository: https://github.com/twipi/cfgutil.git
Documentation: pkg.go.dev

# README

cfgutil

Package cfgutil provides utilities for working with configuration files and environment variables. It supports parsing TOML and JSON files.

# Functions

Parse parses a reader.
ParseFile parses a config file from a path.
ParseJSON parses a JSON config from an io.Reader.
ParseMany parses b into multiple destinations.
TransformMapValues applies a function to each value of a map and returns a new map with the results.
TransformSlice applies a function to each element of a slice and returns a new slice with the results.
VerbosityToLevel converts a base log level and a verbosity integer to a new log level.

# Type aliases

Duration is a type that describes a duration in a config.
MaybeArray is a type that describes a value that can be either a single value or an array of values.