config

package
v0.0.0-...-81a4f0c Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLoggingLevel                  = "info"
	DefaultHttpClientTimeout             = 5 * time.Second
	DefaultWSKeepAliveTime               = 1 * time.Minute
	DefaultWSPort                        = 8443
	DefaultRefreshInterval               = 60 * time.Second
	DefaultCollectInterval               = 30 * time.Second
	DefaultSaveInterval                  = 5 * time.Second
	DefaultMetricCacheSizePerApp         = 1000
	DefaultIsMetricsPersistencySupported = true
	DefaultEnvelopeProcessorCount        = 5
	DefaultEnvelopeChannelSize           = 1000
	DefaultMetricChannelSize             = 1000
	DefaultHTTPServerPort                = 8080
	DefaultHealthPort                    = 8081
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectorConfig

type CollectorConfig struct {
	WSPort                 int             `yaml:"port"`
	WSKeepAliveTime        time.Duration   `yaml:"keep_alive_time"`
	TLS                    models.TLSCerts `yaml:"tls"`
	RefreshInterval        time.Duration   `yaml:"refresh_interval"`
	CollectInterval        time.Duration   `yaml:"collect_interval"`
	SaveInterval           time.Duration   `yaml:"save_interval"`
	MetricCacheSizePerApp  int             `yaml:"metric_cache_size_per_app"`
	PersistMetrics         bool            `yaml:"persist_metrics"`
	EnvelopeProcessorCount int             `yaml:"envelope_processor_count"`
	EnvelopeChannelSize    int             `yaml:"envelope_channel_size"`
	MetricChannelSize      int             `yaml:"metric_channel_size"`
}

type Config

type Config struct {
	Logging           helpers.LoggingConfig `yaml:"logging"`
	HttpClientTimeout time.Duration         `yaml:"http_client_timeout"`
	NodeAddrs         []string              `yaml:"node_addrs"`
	NodeIndex         int                   `yaml:"node_index"`
	DB                DBConfig              `yaml:"db"`
	Collector         CollectorConfig       `yaml:"collector"`
	Server            ServerConfig          `yaml:"server"`
	Health            models.HealthConfig   `yaml:"health"`
}

func LoadConfig

func LoadConfig(reader io.Reader) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type DBConfig

type DBConfig struct {
	PolicyDB          db.DatabaseConfig `yaml:"policy_db"`
	InstanceMetricsDB db.DatabaseConfig `yaml:"instance_metrics_db"`
}

type ServerConfig

type ServerConfig struct {
	Port int             `yaml:"port"`
	TLS  models.TLSCerts `yaml:"tls"`
}

Jump to

Keyboard shortcuts

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