Documentation
¶
Index ¶
- Constants
- Variables
- func BindPFlag(key string, flag *pflag.Flag) error
- func Get(key string) interface{}
- func GetAnalyzerServiceAddresses() ([]service.Address, error)
- func GetBool(key string) bool
- func GetEtcdServerAddrs() []string
- func GetInt(key string) int
- func GetOneAnalyzerServiceAddress() (service.Address, error)
- func GetString(key string) string
- func GetStringMapString(key string) map[string]string
- func GetStringSlice(key string) []string
- func GetTLSClientConfig(setupRootCA bool) (*tls.Config, error)
- func GetTLSServerConfig(setupRootCA bool) (*tls.Config, error)
- func GetURL(protocol string, addr string, port int, path string) (*url.URL, error)
- func InitConfig(backend string, paths []string) error
- func InitLogging() error
- func InitRBAC(kapi etcd.KeysAPI) error
- func IsSet(key string) bool
- func IsTLSEnabled() bool
- func LoadConfig(cfg *viper.Viper, backend string, paths []string) error
- func NewAuthenticationBackendByName(name string) (backend shttp.AuthenticationBackend, err error)
- func NewWSClient(clientType service.Type, url *url.URL, opts websocket.ClientOpts) (*websocket.Client, error)
- func NewWSClientOpts(authOpts *shttp.AuthenticationOpts) (*websocket.ClientOpts, error)
- func NewWSServer(server *shttp.Server, endpoint string, authBackend shttp.AuthenticationBackend) *websocket.Server
- func NewWSServerOpts() websocket.ServerOpts
- func Set(key string, value interface{})
- func SetDefault(key string, value interface{})
- type Config
- type SkydiveConfig
- func (c *SkydiveConfig) Get(key string) interface{}
- func (c *SkydiveConfig) GetAnalyzerServiceAddresses() ([]service.Address, error)
- func (c *SkydiveConfig) GetBool(key string) bool
- func (c *SkydiveConfig) GetEtcdServerAddrs() []string
- func (c *SkydiveConfig) GetInt(key string) int
- func (c *SkydiveConfig) GetOneAnalyzerServiceAddress() (service.Address, error)
- func (c *SkydiveConfig) GetString(key string) string
- func (c *SkydiveConfig) GetStringMapString(key string) map[string]string
- func (c *SkydiveConfig) GetStringSlice(key string) []string
- func (c *SkydiveConfig) GetURL(protocol string, addr string, port int, path string) (*url.URL, error)
- func (c *SkydiveConfig) IsSet(key string) bool
- func (c *SkydiveConfig) IsTLSEnabled() bool
- func (c *SkydiveConfig) Set(key string, value interface{})
- func (c *SkydiveConfig) SetDefault(key string, value interface{})
Constants ¶
const ( // AnalyzerService analyzer AnalyzerService service.Type = "analyzer" // AgentService agent AgentService service.Type = "agent" )
Variables ¶
var ErrNoAnalyzerSpecified = errors.New("No analyzer specified in the configuration file")
ErrNoAnalyzerSpecified error no analyzer section is specified in the configuration file
Functions ¶
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
GetAnalyzerServiceAddresses returns a list of connectable Analyzers
func GetEtcdServerAddrs ¶ added in v0.5.0
func GetEtcdServerAddrs() []string
GetEtcdServerAddrs returns the ETCD server address specified in the configuration file or embedded
func GetOneAnalyzerServiceAddress ¶ added in v0.10.0
GetOneAnalyzerServiceAddress returns a random connectable Analyzer
func GetStringMapString ¶ added in v0.17.0
GetStringMapString returns a map of strings from the configuration
func GetStringSlice ¶ added in v0.17.0
GetStringSlice returns a slice of strings from the configuration
func GetTLSClientConfig ¶ added in v0.20.0
GetTLSClientConfig returns TLS config to be used by client
func GetTLSServerConfig ¶ added in v0.20.0
GetTLSServerConfig returns TLS config to be used by server
func GetURL ¶ added in v0.14.0
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
InitConfig global config
func InitLogging ¶ added in v0.20.0
func InitLogging() error
InitLogging set up logging based on the section "logging" of the configuration file
func InitRBAC ¶ added in v0.20.0
InitRBAC inits the RBAC mechanism. It load - the model from the configuration - a policy on etcd - a policy bundled in the executable - additional policy rules from the configuration
func IsTLSEnabled ¶ added in v0.20.0
func IsTLSEnabled() bool
IsTLSEnabled returns true is the client / server certificates are set
func LoadConfig ¶ added in v0.25.0
LoadConfig initializes config with the given backend/path
func NewAuthenticationBackendByName ¶ added in v0.20.0
func NewAuthenticationBackendByName(name string) (backend shttp.AuthenticationBackend, err error)
NewAuthenticationBackendByName creates a new auth backend based on the name
func NewWSClient ¶ added in v0.20.0
func NewWSClient(clientType service.Type, url *url.URL, opts websocket.ClientOpts) (*websocket.Client, error)
NewWSClient creates a Client based on the configuration
func NewWSClientOpts ¶ added in v0.27.0
func NewWSClientOpts(authOpts *shttp.AuthenticationOpts) (*websocket.ClientOpts, error)
NewWSClientOpts creates WebSocket options object from the configuration
func NewWSServer ¶ added in v0.20.0
func NewWSServer(server *shttp.Server, endpoint string, authBackend shttp.AuthenticationBackend) *websocket.Server
NewWSServer creates a Server based on the configuration
func NewWSServerOpts ¶ added in v0.27.0
func NewWSServerOpts() websocket.ServerOpts
NewWSServerOpts returns WebSocket server options
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 the default configuration value for a key
Types ¶
type Config ¶ added in v0.25.0
type Config interface { SetDefault(key string, value interface{}) IsSet(key string) bool Get(key string) interface{} Set(key string, value interface{}) GetBool(key string) bool GetInt(key string) int GetString(key string) string GetStringSlice(key string) []string GetStringMapString(key string) map[string]string GetStringMap(key string) map[string]interface{} }
Config defines a config interface
type SkydiveConfig ¶ added in v0.25.0
SkydiveConfig implements the Config interface
func (*SkydiveConfig) Get ¶ added in v0.25.0
func (c *SkydiveConfig) Get(key string) interface{}
Get returns a value of the configuration as in interface
func (*SkydiveConfig) GetAnalyzerServiceAddresses ¶ added in v0.25.0
func (c *SkydiveConfig) GetAnalyzerServiceAddresses() ([]service.Address, error)
GetAnalyzerServiceAddresses returns a list of connectable Analyzers
func (*SkydiveConfig) GetBool ¶ added in v0.25.0
func (c *SkydiveConfig) GetBool(key string) bool
GetBool returns a boolean from the configuration
func (*SkydiveConfig) GetEtcdServerAddrs ¶ added in v0.25.0
func (c *SkydiveConfig) GetEtcdServerAddrs() []string
GetEtcdServerAddrs returns the ETCD server address specified in the configuration file or embedded
func (*SkydiveConfig) GetInt ¶ added in v0.25.0
func (c *SkydiveConfig) GetInt(key string) int
GetInt returns an interger from the configuration
func (*SkydiveConfig) GetOneAnalyzerServiceAddress ¶ added in v0.25.0
func (c *SkydiveConfig) GetOneAnalyzerServiceAddress() (service.Address, error)
GetOneAnalyzerServiceAddress returns a random connectable Analyzer
func (*SkydiveConfig) GetString ¶ added in v0.25.0
func (c *SkydiveConfig) GetString(key string) string
GetString returns a string from the configuration
func (*SkydiveConfig) GetStringMapString ¶ added in v0.25.0
func (c *SkydiveConfig) GetStringMapString(key string) map[string]string
GetStringMapString returns a map of strings from the configuration
func (*SkydiveConfig) GetStringSlice ¶ added in v0.25.0
func (c *SkydiveConfig) GetStringSlice(key string) []string
GetStringSlice returns a slice of strings from the configuration
func (*SkydiveConfig) GetURL ¶ added in v0.25.0
func (c *SkydiveConfig) GetURL(protocol string, addr string, port int, path string) (*url.URL, error)
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 (*SkydiveConfig) IsSet ¶ added in v0.25.0
func (c *SkydiveConfig) IsSet(key string) bool
IsSet returns wether a key is set
func (*SkydiveConfig) IsTLSEnabled ¶ added in v0.25.0
func (c *SkydiveConfig) IsTLSEnabled() bool
IsTLSEnabled returns true is the client / server certificates are set
func (*SkydiveConfig) Set ¶ added in v0.25.0
func (c *SkydiveConfig) Set(key string, value interface{})
Set a value of the configuration
func (*SkydiveConfig) SetDefault ¶ added in v0.25.0
func (c *SkydiveConfig) SetDefault(key string, value interface{})
SetDefault set the default configuration value for a key