Documentation
¶
Overview ¶
Package config implements various config structs required in the application.
It implements Check which implements the checker.Check and Component which implements the checker.Component interfaces.
Also implements the provider interface for metrics.
Subpackage configfile includes the configs that are implemented as config files for the application. This includes agents, central server and the app server.
Index ¶
- type Alert
- type AlertProvider
- type Check
- func (c *Check) GetID() string
- func (c *Check) GetInput() checker.Component
- func (c *Check) GetInterval() time.Duration
- func (c *Check) GetName() string
- func (c *Check) GetOutput() checker.Component
- func (c *Check) GetPayloads() []checker.Component
- func (c *Check) GetTarget() checker.Component
- func (c *Check) GetTimeout() time.Duration
- type Component
- type DBConn
- type Metric
- type MetricsProvider
- func (m *MetricsProvider) GetBackend() string
- func (m *MetricsProvider) GetDBName() string
- func (m *MetricsProvider) GetHost() string
- func (m *MetricsProvider) GetPassword() string
- func (m *MetricsProvider) GetPort() uint16
- func (m *MetricsProvider) GetUsername() string
- func (m *MetricsProvider) IsSSLMode() bool
- type OauthProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { Service string `json:"service" mapstructure:"service"` Target string `json:"target" mapstructure:"target"` }
Alert configures where alert is to be sent.
func (*Alert) GetService ¶
GetService returns the service name of the alert.
type AlertProvider ¶
type AlertProvider struct { Service string `json:"service" mapstructure:"service"` Host string `json:"host" mapstructure:"host"` Port uint16 `json:"port" mapstructure:"port"` User string `json:"user" mapstructure:"user"` Secret string `json:"secret" mapstructure:"secret"` }
AlertProvider configures the alerter.
This implements the alerter.Provider interface.
func (*AlertProvider) GetHost ¶
func (a *AlertProvider) GetHost() string
GetHost returns the host name of the service provider.
func (*AlertProvider) GetPort ¶
func (a *AlertProvider) GetPort() uint16
GetPort returns the port number of the service provider.
func (*AlertProvider) GetSecret ¶
func (a *AlertProvider) GetSecret() string
GetSecret returns the secret key for configuring provider.
func (*AlertProvider) GetService ¶
func (a *AlertProvider) GetService() string
GetService returns the service name of the provider.
func (*AlertProvider) GetUser ¶
func (a *AlertProvider) GetUser() string
GetUser returns the user identifier of the service provider.
type Check ¶
type Check struct { ID string `mapstructure:"id" json:"id"` Name string `mapstructure:"name" json:"name"` Interval time.Duration `mapstructure:"interval" json:"interval"` Timeout time.Duration `mapstructure:"timeout" json:"timeout"` Input Component `mapstructure:"input" json:"input"` Output Component `mapstructure:"output" json:"output"` Target Component `mapstructure:"target" json:"target"` Payloads []Component `mapstructure:"payloads" json:"payloads"` Alerts []Alert `mapstructure:"alerts" json:"alerts"` }
Check is the configuration of each check associated with each check.
Implements checker.Check interface.
func ProtoToCheck ¶
ProtoToCheck converts a proto.Check into checker.Check.
func (*Check) GetInterval ¶
GetInterval returns the interval of the check.
func (*Check) GetPayloads ¶
GetPayloads returns the payloads for the check.
func (*Check) GetTimeout ¶
GetTimeout returns the timeout of the check.
type Component ¶
type Component struct { Type string `mapstructure:"type" json:"type"` Value string `mapstructure:"value" json:"value"` }
Component is a key-value pair.
Implements Component interface.
type DBConn ¶
type DBConn struct { Host string Port uint16 Name string Username string Password string SSLMode bool }
DBConn config
func (*DBConn) GetPassword ¶
GetPassword returns the password of the database provider.
func (*DBConn) GetUsername ¶
GetUsername returns the username of the database provider.
type Metric ¶
type Metric struct { CheckID string CheckName string Successful bool Timeout bool StartTime time.Time Duration time.Duration }
Metric represents the result of a check.
Implements the checker.Metric interface.
func (*Metric) GetCheckID ¶
GetCheckID returns the ID of the check for which the metric is.
func (*Metric) GetCheckName ¶
GetCheckName returns the name of the check.
func (*Metric) GetDuration ¶
GetDuration returns the duration that check took to run.
func (*Metric) GetStartTime ¶
GetStartTime returns the start-time of the check.
func (*Metric) IsSuccessful ¶
IsSuccessful tells if the check was successful.
type MetricsProvider ¶
type MetricsProvider struct { Backend string `mapstructure:"backend" json:"backend"` Host string `mapstructure:"host" json:"host"` Port uint16 `mapstructure:"port" json:"port"` DBName string `mapstructure:"db_name" json:"db_name"` Username string `mapstructure:"username" json:"username"` Password string `mapstructure:"password" json:"password"` SSLMode bool `mapstructure:"ssl_mode" json:"ssl_mode"` }
MetricsProvider represents the configuration of a metrics exporter.
Implements the metrics.Provider interface.
func (*MetricsProvider) GetBackend ¶
func (m *MetricsProvider) GetBackend() string
GetBackend returns the backend of the provider.
func (*MetricsProvider) GetDBName ¶
func (m *MetricsProvider) GetDBName() string
GetDBName returns the database name of the provider.
func (*MetricsProvider) GetHost ¶
func (m *MetricsProvider) GetHost() string
GetHost returns the host of the database provider.
func (*MetricsProvider) GetPassword ¶
func (m *MetricsProvider) GetPassword() string
GetPassword returns the password of the database provider.
func (*MetricsProvider) GetPort ¶
func (m *MetricsProvider) GetPort() uint16
GetPort returns the port of the database provider.
func (*MetricsProvider) GetUsername ¶
func (m *MetricsProvider) GetUsername() string
GetUsername returns the username of the database provider.
func (*MetricsProvider) IsSSLMode ¶
func (m *MetricsProvider) IsSSLMode() bool
IsSSLMode tells if the connection with the provider is to be established through SSL.
type OauthProvider ¶
type OauthProvider struct { Provider string `mapstructure:"provider" json:"provider"` ClientID string `mapstructure:"client_id" json:"client_id"` ClientSecret string `mapstructure:"client_secret" json:"client_secret"` RedirectURL string `mapstructure:"redirect_url" json:"redirect_url"` Scopes []string `mapstructure:"scopes" json:"scopes"` }
OauthProvider is configures the service that provides authentication through OAuth2.
func (*OauthProvider) GetClientID ¶
func (o *OauthProvider) GetClientID() string
GetClientID returns the client ID of the provider.
func (*OauthProvider) GetClientSecret ¶
func (o *OauthProvider) GetClientSecret() string
GetClientSecret returns the client secret of the provider.
func (*OauthProvider) GetProvider ¶
func (o *OauthProvider) GetProvider() string
GetProvider returns the provider name.
func (*OauthProvider) GetRedirectURL ¶
func (o *OauthProvider) GetRedirectURL() string
GetRedirectURL returns the redirect URL.
func (*OauthProvider) GetScopes ¶
func (o *OauthProvider) GetScopes() []string
GetScopes returns the scopes.
Directories
¶
Path | Synopsis |
---|---|
Package configfile contains the config structures for the components which are to be represented by a config file.
|
Package configfile contains the config structures for the components which are to be represented by a config file. |