vipertools

package
v1.90.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstNonEmptyBool

func FirstNonEmptyBool(v *viper.Viper, keys ...string) bool

FirstNonEmptyBool accepts multiple keys and returns the first non-empty bool value from viper.Viper via these keys. Non-empty meaning false value will not be accepted.

func FirstNonEmptyInt

func FirstNonEmptyInt(v *viper.Viper, keys ...string) (int, bool)

FirstNonEmptyInt accepts multiple keys and returns the first non-empty int value from viper.Viper via these keys. Non-empty meaning 0 value will not be accepted. Will return false as second parameter, if non-empty int value could not be retrieved.

func FirstNonEmptyString

func FirstNonEmptyString(v *viper.Viper, keys ...string) string

FirstNonEmptyString accepts multiple keys and returns the first non-empty string value from viper.Viper via these keys. Returns empty string by default if a value couldn't be found.

func GetString added in v1.7.1

func GetString(v *viper.Viper, key string) string

GetString gets a parameter/setting by key and strips any quotes.

func GetStringMapString added in v1.42.1

func GetStringMapString(v *viper.Viper, prefix string) map[string]string

GetStringMapString gets a parameter/setting by key prefix and strips any quotes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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