sourcers

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

sourcers

Adds simple, additional Sourcers to ardanlabs/conf.

Rationale

You like using conf and don't want to switch to spf13/viper, but your command line or list of environment variables is getting long. You wish you could simply drop a config.json, config.yaml, or config.toml in your container to simplify your life.

Or, you want to write your own Sourcer and aren't quite sure how.

This package is your answer.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From added in v1.2.0

func From(f UnmarshalFunc, r io.Reader) (conf.Sourcer, error)

From returns a conf.Sourcer and an error when receiving an UnmarshalFunc and an io.Reader containing the configuration in the requested format.

This is a helper func for subpackages and custom formats.

Types

type UnmarshalFunc added in v1.2.0

type UnmarshalFunc func([]byte, interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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