config

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2018 License: Apache-2.0 Imports: 10 Imported by: 92

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAnalyzerSpecified = errors.New("No analyzer specified in the configuration file")

ErrNoAnalyzerSpecified error no analyzer section is specified in the configuration file

Functions

func BindPFlag added in v0.17.0

func BindPFlag(key string, flag *pflag.Flag) error

BindPFlag binds a command line flag to a configuration value

func Get added in v0.17.0

func Get(key string) interface{}

Get returns a value of the configuration as in interface

func GetAnalyzerServiceAddresses added in v0.10.0

func GetAnalyzerServiceAddresses() ([]common.ServiceAddress, error)

GetAnalyzerServiceAddresses returns a list of connectable Analyzers

func GetBool added in v0.17.0

func GetBool(key string) bool

GetBool returns a boolean from the configuration

func GetConfig

func GetConfig() *viper.Viper

GetConfig get current config

func GetEtcdServerAddrs added in v0.5.0

func GetEtcdServerAddrs() []string

GetEtcdServerAddrs returns the ETCD server address specified in the configuration file or embedded

func GetInt added in v0.17.0

func GetInt(key string) int

GetInt returns an interger from the configuration

func GetOneAnalyzerServiceAddress added in v0.10.0

func GetOneAnalyzerServiceAddress() (common.ServiceAddress, error)

GetOneAnalyzerServiceAddress returns a random connectable Analyzer

func GetString added in v0.17.0

func GetString(key string) string

GetString returns a string from the configuration

func GetStringMapString added in v0.17.0

func GetStringMapString(key string) map[string]string

GetStringMapString returns a map of strings from the configuration

func GetStringSlice added in v0.17.0

func GetStringSlice(key string) []string

GetStringSlice returns a slice of strings from the configuration

func GetURL added in v0.14.0

func GetURL(protocol string, addr string, port int, path string) *url.URL

GetURL constructs a URL from a tuple of protocol, address, port and path If TLS is enabled, it will return the https (or wss) version of the URL.

func InitConfig added in v0.4.0

func InitConfig(backend string, paths []string) error

InitConfig with a backend

func IsTLSenabled added in v0.12.0

func IsTLSenabled() bool

IsTLSenabled returns true is the analyzer certificates are set

func Set added in v0.17.0

func Set(key string, value interface{})

Set a value of the configuration

func SetDefault added in v0.2.0

func SetDefault(key string, value interface{})

SetDefault set default configuration key the value

Types

This section is empty.

Jump to

Keyboard shortcuts

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