autgofig

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2018 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(configOut interface{}, projectName string) error

configOut must be a pointer to a struct containing the configuration fields, which must be exported fields. the struct passed will receive the values either given by prompts, or found in the .yml file. LoadConfig will set up a Loader, which will not be returned. Use NewLoader if you would like access to the Loader. The yml file's name is determined by the projectName parameter, e.g. "~/" + "." + projectName + ".yml" if any of the fields exist on the system as environment variables, they will be loaded as such over the yml config.

Types

type Loader

type Loader struct {
	ConfLocation string
	Separator    string
	Config       interface{}

	HomeDir string
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader(configOut interface{}, projectName string) (*Loader, error)

Same as LoadConfig, except also returns the Loader, which contains useful OS specific variables. Such as directory separators and the users home directory.

Jump to

Keyboard shortcuts

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