config

package
v0.0.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package config is a wrapper on viper to simplify config struct populating current implementation works with single viper instance casual flow of using its public API: ReadFromFiles() -> MergeEnv() if ReadFromFiles() invocation is skipped than MergeEnv() need to be invoked to get all config values from env variables

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeEnv

func MergeEnv(envPrefix string, config interface{}) error

MergeEnv Merges config properties from env variables. for simple types it replaces values. For slices if initial value was []string{"pod0", "pod1", "pod2"} and env variable contains only "pod33", merge result will be equal to []string{"pod33", "pod1", "pod2"}

func ReadFromFiles

func ReadFromFiles(config interface{}, configPaths []string) error

ReadFromFiles reads config from file trying find config file in paths listed in `configPaths string`

func UsedFileName

func UsedFileName() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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