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: 1 module, 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.

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
⌂ 换网址