viper

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 5 Imported by: 1

README

viper

Package viper is a library for manipulating Vipers. See GoDoc for details.

Documentation

Overview

Package viper is a library for manipulating vipers (https://github.com/spf13/viper).

This version of the package is compatible with Viper v1.4.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileViper

func NewFileViper(filePath string, format string) (*viper.Viper, error)

NewFileViper () is a simple interface for creating file-based vipers.

The first parametre of this function should be the path of the file. Relative and absolute paths are supported.

This second parametre should be a file format supported by viper (github.com/spf13/viper). To put in simpler terms, this value must be a valid parametre for method someViper.SetConfigType (), as this parametre would be passed to the method.

Method someViper.ReadInConfig () is not called by this function, so you would have to do it yourself.

v1, err1 := viper.NewFileViper ("../someDir/file.ext", "json")
v2, err2 := viper.NewFileViper ("/etc/file", "yaml")
v3, err3 := viper.NewFileViper ("file.ext", "yaml")

Types

This section is empty.

Jump to

Keyboard shortcuts

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