config

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(v *viper.Viper, command *cobra.Command, inits ...func(*flag.FlagSet)) (*viper.Viper, *cobra.Command)

AddFlags adds flags to command and viper and configures

func Viperize

func Viperize(inits ...func(*flag.FlagSet)) (*viper.Viper, *cobra.Command)

Viperize creates new Viper and command add passes flags to command Viper is initialized with flags from command and configured to accept flags as environmental variables. Characters `.-` in environmental variables are changed to `_`

Types

type StringSlice added in v1.17.0

type StringSlice []string

StringSlice implements the pflag.Value interface and allows for parsing multiple

config values with the same name

It purposefully mimics pFlag.stringSliceValue (https://github.com/spf13/pflag/blob/master/string_slice.go)

in order to be treated like a string slice by both viper and pflag cleanly

func (*StringSlice) Set added in v1.17.0

func (l *StringSlice) Set(value string) error

Set implements pflag.Value

func (*StringSlice) String added in v1.17.0

func (l *StringSlice) String() string

String implements pflag.Value

func (*StringSlice) Type added in v1.17.0

func (l *StringSlice) Type() string

Type implements pflag.Value

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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