config

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigWrapper added in v0.6.4

type ConfigWrapper struct {
	Viper *viper.Viper
	// contains filtered or unexported fields
}

func NewConfig added in v0.6.4

func NewConfig() *ConfigWrapper

func ReadConfig added in v0.14.4

func ReadConfig(configName string) *ConfigWrapper

ReadConfig initializes a ConfigWrapper and reads `configName`

func (*ConfigWrapper) GetDatabase added in v0.14.4

func (c *ConfigWrapper) GetDatabase() DBConfig

GetDatabase returns postgresql database server connection config

func (*ConfigWrapper) IsProduction added in v0.14.4

func (c *ConfigWrapper) IsProduction() bool

IsProduction is true if we are running in a production environment

func (*ConfigWrapper) Override added in v0.14.4

func (c *ConfigWrapper) Override(key string, value interface{})

Override sets a setting key value to whatever you supply. Useful in tests:

config.Override("Lbrynet", "http://www.google.com:8080/api/proxy")
defer config.RestoreOverridden()
...

func (*ConfigWrapper) RestoreOverridden added in v0.14.4

func (c *ConfigWrapper) RestoreOverridden()

RestoreOverridden restores original v values overridden by Override

type DBConfig added in v0.6.4

type DBConfig struct {
	Connection string
	DBName     string
	Options    string
}

Jump to

Keyboard shortcuts

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