viper

package
v0.0.0-...-fe78ce7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoConfig

func AutoConfig(basename, envPrefix, file string)

func GetBool

func GetBool(key Key) bool

func GetDuration

func GetDuration(key Key) time.Duration

func GetInt

func GetInt(key Key) int

func GetString

func GetString(key Key) string

func MustBindFlag

func MustBindFlag(key Key, cmd *cobra.Command, flag *pflag.Flag)

func MustBindFlagLookup

func MustBindFlagLookup(key Key, cmd *cobra.Command, flagName string)

func MustBindPersistentFlagLookup

func MustBindPersistentFlagLookup(key Key, cmd *cobra.Command, flagName string)

func Set

func Set(key Key, value interface{})

Types

type Key

type Key string
const (
	KeyLogFile                 Key = "log.file"
	KeyLogDebug                Key = "log.debug"
	KeyLogTrace                Key = "log.trace"
	KeyLogTee                  Key = "log.tee"
	KeyDbURL                   Key = "db.url"
	KeyDbDriver                Key = "db.driver"
	KeyDbConnMaxTotal          Key = "db.conn.max_total"
	KeyDbConnMaxIdle           Key = "db.conn.max_idle"
	KeyDbConnMaxLifetime       Key = "db.conn.max_lifetime"
	KeyRedisURL                Key = "redis.url"
	KeyRedisMaxRetries         Key = "redis.max_retries"
	KeyRedisMinRetryBackoff    Key = "redis.min_retry_backoff"
	KeyRedisMaxRetryBackoff    Key = "redis.max_retry_backoff"
	KeyRedisDialTimeout        Key = "redis.dial_timeout"
	KeyRedisReadTimeout        Key = "redis.read_timeout"
	KeyRedisWriteTimeout       Key = "redis.write_timeout"
	KeyRedisPoolSize           Key = "redis.pool_size"
	KeyRedisMinIdleConns       Key = "redis.min_idle_conns"
	KeyRedisMaxConnAge         Key = "redis.max_conn_age"
	KeyRedisPoolTimeout        Key = "redis.pool_timeout"
	KeyRedisIdleTimeout        Key = "redis.idle_timeout"
	KeyRedisIdleCheckFrequency Key = "redis.idle_check_freq"
	KeySteamUser               Key = "steam.user"
	KeySteamPassword           Key = "steam.password"
	KeySteamAPIKey             Key = "steam.api_key"
	KeyOpendotaAPIKey          Key = "opendota.api_key"
)

Jump to

Keyboard shortcuts

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