config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTwoManyInputs = errors.New("too many input types, provide only one")

Functions

func FromJsonFile

func FromJsonFile(path string, target interface{}) error

FromJsonFile reads a json file from the given path and loads into the target interface. An error is returned if any is encountered during the file reading or json unmarshalling.

func FromReader

func FromReader(r io.Reader, target interface{}) error

FromReader reads bytes off the given reader and loads into the target interface. An error is returned if any is encountered during json unmarshalling.

func WithEnv

func WithEnv() optfunc

func WithFilePath

func WithFilePath(path string) optfunc

func WithOptions

func WithOptions(target any, funcs ...optfunc) error

WithOptions provides many ways to load config into `target`.

func WithReader

func WithReader(r io.Reader) optfunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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