Documentation ¶
Index ¶
- type AWS
- type Config
- func (c Config) GetAWSConfig() AWS
- func (c *Config) GetConfigData(path string) []byte
- func (c Config) GetDBConfig() DatabaseConfig
- func (c Config) GetHTTPClientConfig() *HTTPClientConfig
- func (c Config) GetHTTPConfig() HTTPServerConfig
- func (c Config) GetLogLevel() logging.Level
- func (c Config) GetSentryDSN() string
- func (c Config) GetTransportInfo() InfoInterface
- func (c Config) GetUpdateInterval() int
- func (c Config) GetVersion() string
- func (c Config) GetZabbixConfig() ZabbixConfig
- func (c Config) IsDebug() bool
- func (c *Config) LoadConfig(path string) *Config
- func (c *Config) LoadConfigFromData(data []byte) *Config
- type Configuration
- type DatabaseConfig
- type HTTPClientConfig
- type HTTPServerConfig
- type Info
- type InfoInterface
- type ZabbixConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWS ¶
type AWS struct { AccessKeyID string `yaml:"access_key_id"` SecretAccessKey string `yaml:"secret_access_key"` Endpoint string `yaml:"endpoint"` Region string `yaml:"region"` Bucket string `yaml:"bucket"` FolderName string `yaml:"folder_name"` ContentType string `yaml:"content_type"` }
AWS struct.
type Config ¶
type Config struct { HTTPClientConfig *HTTPClientConfig `yaml:"http_client"` ConfigAWS AWS `yaml:"config_aws"` TransportInfo Info `yaml:"transport_info"` HTTPServer HTTPServerConfig `yaml:"http_server"` ZabbixConfig ZabbixConfig `yaml:"zabbix"` Version string `yaml:"version"` SentryDSN string `yaml:"sentry_dsn"` Database DatabaseConfig `yaml:"database"` UpdateInterval int `yaml:"update_interval"` LogLevel logging.Level `yaml:"log_level"` Debug bool `yaml:"debug"` }
Config struct.
func NewConfig ¶
NewConfig reads configuration file and returns config instance Usage:
NewConfig("config.yml")
func (*Config) GetConfigData ¶
GetConfigData returns config file data in form of byte sequence.
func (Config) GetDBConfig ¶
func (c Config) GetDBConfig() DatabaseConfig
GetDBConfig database configuration.
func (Config) GetHTTPClientConfig ¶
func (c Config) GetHTTPClientConfig() *HTTPClientConfig
GetHTTPClientConfig returns http client config.
func (Config) GetHTTPConfig ¶
func (c Config) GetHTTPConfig() HTTPServerConfig
GetHTTPConfig server configuration.
func (Config) GetSentryDSN ¶
GetSentryDSN sentry connection dsn.
func (Config) GetTransportInfo ¶
func (c Config) GetTransportInfo() InfoInterface
GetTransportInfo transport basic data.
func (Config) GetUpdateInterval ¶
GetUpdateInterval user data update interval.
func (Config) GetZabbixConfig ¶ added in v2.6.4
func (c Config) GetZabbixConfig() ZabbixConfig
GetZabbixConfig returns zabbix configuration.
func (*Config) LoadConfig ¶
LoadConfig read & load configuration file.
func (*Config) LoadConfigFromData ¶
LoadConfigFromData loads config from byte sequence.
type Configuration ¶
type Configuration interface { GetVersion() string GetSentryDSN() string GetLogLevel() logging.Level GetHTTPConfig() HTTPServerConfig GetZabbixConfig() ZabbixConfig GetDBConfig() DatabaseConfig GetAWSConfig() AWS GetTransportInfo() InfoInterface GetHTTPClientConfig() *HTTPClientConfig GetUpdateInterval() int IsDebug() bool }
Configuration settings data structure.
type DatabaseConfig ¶
type DatabaseConfig struct { Connection interface{} `yaml:"connection"` TablePrefix string `yaml:"table_prefix"` MaxOpenConnections int `yaml:"max_open_connections"` MaxIdleConnections int `yaml:"max_idle_connections"` ConnectionLifetime int `yaml:"connection_lifetime"` Logging bool `yaml:"logging"` }
DatabaseConfig struct.
type HTTPClientConfig ¶
type HTTPClientConfig struct { SSLVerification *bool `yaml:"ssl_verification"` MockAddress string `yaml:"mock_address"` MockedDomains []string `yaml:"mocked_domains"` Timeout time.Duration `yaml:"timeout"` }
HTTPClientConfig struct.
func (*HTTPClientConfig) IsSSLVerificationEnabled ¶
func (h *HTTPClientConfig) IsSSLVerificationEnabled() bool
IsSSLVerificationEnabled returns SSL verification flag (default is true).
type HTTPServerConfig ¶
HTTPServerConfig struct.
type Info ¶
type Info struct { Name string `yaml:"name"` Code string `yaml:"code"` LogoPath string `yaml:"logo_path"` Secret string `yaml:"secret"` }
Info struct.
type InfoInterface ¶
type InfoInterface interface { GetName() string GetCode() string GetLogoPath() string GetSecret() string }
InfoInterface transport settings data structure.
type ZabbixConfig ¶ added in v2.6.4
type ZabbixConfig struct { ServerHost string `yaml:"server_host"` Host string `yaml:"host"` ServerPort int `yaml:"server_port"` MetricPrefix string `yaml:"metric_prefix"` Interval uint64 `yaml:"interval"` }
ZabbixConfig contains information about Zabbix connection.