gofigure

package module
v0.0.0-...-3924b68 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: MIT Imports: 6 Imported by: 1

README

#go-figure GoDoc codebeat badge Build Status Coverage Status Go Report Card go-figure is a multi-file, multi-configuration package configuration to handle old-school configuration techniques such searching for as multiple files in multiple folders (~/something.d, /etc/something.d, ...).

It does expand standard shell parameters in the path list via os.ExpandEnv().

#Usage

Generally the following should be done:

    ...
    v := viper.New()
    v.SetConfigType("yml|json|yaml")
    gofigure.Parse(v, []string{"${HOME}/.app.d", "${CFGD}", "/etc/app.d"})
    ...
    //do something with v

Documentation

Overview

Package gofigure provide some simple utility functions around a Viper instance

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(v *viper.Viper, paths []string) error

Parse populates the viper instance walking through the passed paths, loading any files found in the directory. It silently ignores any errors (bad files, etc)

func ReadFrom

func ReadFrom(v *viper.Viper, readers []io.ReadCloser) error

ReadFrom populates the viper instance walking through the passed list of ReadClosers.

It returns a non-nil err It silently ignores any errors (bad files, etc) and attempts to Close() the file afterwards

Types

This section is empty.

Jump to

Keyboard shortcuts

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