modulepackage
0.0.0-20220822221314-86fa169f9f99
Repository: https://github.com/olebedev/config.git
Documentation: pkg.go.dev
# README
Config

Package config provides convenient access methods to configuration stored as JSON or YAML.
This is a fork of the original version. This version extends the functionality of the original without losing compatibility. Major features added:
Set(path string, value interface{}) error
methodEnv() *config.Config
method, for OS environment variables parsingFlag() *config.Config
method, for command line arguments parsing usign pkg/flag singletonArgs(args ...string) *config.Config
method, for command line arguments parsingU*
methodsCopy(...path) (*config.config, error)
methodExtend(*config.Config) (*config.Config, error)
methodError() error
method to show last parsing error, works only with.Args()
method
Example and more information you can find here.
# Functions
Get returns a child of the given value according to a dotted path.
Must is a wrapper for parsing functions to be used during initialization.
ParseJson reads a JSON configuration from the given string.
ParseJsonFile reads a JSON configuration from the given filename.
ParseYaml reads a YAML configuration from the given string.
ParseYamlBytes reads a YAML configuration from the given []byte.
ParseYamlFile reads a YAML configuration from the given filename.
RenderJson renders a JSON configuration.
RenderYaml renders a YAML configuration.
Set returns an error, in case when it is not possible to establish the value obtained in accordance with given dotted path.