config

package module
v0.0.0-...-905c385 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2018 License: MIT Imports: 2 Imported by: 0

README

config

For handling app configuration

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RelativeResource

func RelativeResource(fileName string, dirs ...string) (fp string, fe error)

RelativeResource returns the file path

1 - searchs inside dirs, in the same order of dirs
2 - searchs inside working directory
3 - searchs inside app directory

otherwise returns os.ErrNotExist error

Types

type Loader

type Loader interface {
	Load(ptr interface{}, filePath ...string) error
}

Loader loads the config into a struct which is passed as a pointer

type LoaderFunc

type LoaderFunc func(interface{}, ...string) error

LoaderFunc is a function type that implements Loader

func (LoaderFunc) Load

func (lf LoaderFunc) Load(ptr interface{}, filePath ...string) error

Load implements Loader

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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