repository

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultConfigsPath default directory with combainer configs
	DefaultConfigsPath = "/etc/combaine"
)

Variables

This section is empty.

Functions

func GetAggregationConfigs

func GetAggregationConfigs(pConfig *ParsingConfig, pName string) (*map[string]AggregationConfig, error)

GetAggregationConfigs return aggregation configs for specified parsing config

func GetBasePath

func GetBasePath() string

GetBasePath return basepath of the repository

func Init

func Init(basepath string) error

Init initialize config repository

func ListAggregationConfigs

func ListAggregationConfigs() ([]string, error)

ListAggregationConfigs list all aggregation configs in the repository

func ListParsingConfigs

func ListParsingConfigs() ([]string, error)

ListParsingConfigs list all parsing configs in the repository

func PluginConfigsUpdate

func PluginConfigsUpdate(target *PluginConfig, source *PluginConfig)

PluginConfigsUpdate update target PluginConfig with content from source PluginConfig

func VerifyCombainerConfig

func VerifyCombainerConfig(cfg *CombainerConfig) error

VerifyCombainerConfig check combainer config

Types

type AggregationConfig

type AggregationConfig struct {
	// Configuration of data handlers (aka parsers)
	Data map[string]PluginConfig `yaml:"data"`
	// Configuration of possible senders
	Senders map[string]PluginConfig `yaml:"senders"`
}

AggregationConfig represent aggregation section from combainer client config

func (*AggregationConfig) Encode

func (a *AggregationConfig) Encode() ([]byte, error)

Encode encode aggregation config

type CacheConfig

type CacheConfig struct {
	TTL      int64 `yaml:"ttl"`
	Interval int64 `yaml:"interval"`
}

CacheConfig for TTLCache

type CloudSection

type CloudSection struct {
	// Default DataFetcher
	DataFetcher PluginConfig `yaml:"DataFetcher"`
	HostFetcher PluginConfig `yaml:"HostFetcher"`
}

CloudSection configure fetchers and discovery

type ClusterConfig

type ClusterConfig struct {
	BindAddr string `yaml:"BindAddr"`
	RaftPort int    `yaml:"RaftPort"`
	// expect N serf nodes to bootstrap raft cluster
	BootstrapExpect    uint          `yaml:"BootstrapExpect"`
	StartAsLeader      bool          `yaml:"StartAsLeader"`
	RaftUpdateInterval time.Duration `yaml:"RaftUpdateInterval"`
}

ClusterConfig about serf and raft

type CombainerConfig

type CombainerConfig struct {
	CombainerSection `yaml:"Combainer"`
	CloudSection     `yaml:"cloud_config"`
}

CombainerConfig container for all other configs

func GetCombainerConfig

func GetCombainerConfig() (cfg CombainerConfig)

GetCombainerConfig load conbainer's main config

func NewCombaineConfig

func NewCombaineConfig(path string) (config CombainerConfig, err error)

NewCombaineConfig load conbainer's main config

type CombainerSection

type CombainerSection struct {
	MainSection `yaml:"Main"`
}

CombainerSection about combainer daemon configs

type EncodedConfig

type EncodedConfig []byte

EncodedConfig is the bytes of the configs readed

func GetAggregationConfig

func GetAggregationConfig(name string) (EncodedConfig, error)

GetAggregationConfig load aggregation config

func GetParsingConfig

func GetParsingConfig(name string) (EncodedConfig, error)

GetParsingConfig load parsing config

func (*EncodedConfig) Decode

func (e *EncodedConfig) Decode(inplace interface{}) error

Decode Unmarshal yaml config

type MainSection

type MainSection struct {
	ClusterConfig    ClusterConfig `yaml:"Cluster"`
	ParallelParsings int           `yaml:"ParallelParsings"`
	// distribute aggregations across a "cluster", or make them "local"ly
	DistributeAggregation string `yaml:"DistributeAggregation"`
	// Duration of iteration in sec
	// Pasring stage longs at least 0.8 * MinimumPeriod
	IterationDuration uint `yaml:"MINIMUM_PERIOD"`
	// Groups of cloud machines
	CloudGroups []string `yaml:"cloud"`
	// combaine cloud hosts fetcher
	HostFetcher PluginConfig `yaml:"HostFetcher,omitempty"`
	// Cache TTLCache options
	Cache CacheConfig `yaml:"cache,omitempty"`
}

MainSection describes Main section in combaine.yaml

type ParsingConfig

type ParsingConfig struct {
	// List of host groups
	Groups []string `yaml:"groups"`
	// List of names of Aggregation configs
	AggConfigs []string `yaml:"agg_configs"`
	// Overrides the same section in combainer.yaml
	DataFetcher PluginConfig `yaml:"DataFetcher,omitempty"`
	// Overrides name of host group
	Metahost string `yaml:"metahost" codec:"metahost"`
	// MainSection contains server configs
	MainSection `yaml:"Combainer"`
	// Overrides the same section in combainer.yaml
	HostFetcher PluginConfig `yaml:"HostFetcher,omitempty"`
}

ParsingConfig contains settings from parsing section of combainer configs

func (*ParsingConfig) Encode

func (p *ParsingConfig) Encode() ([]byte, error)

Encode encode parsing config

func (*ParsingConfig) UpdateByCombainerConfig

func (p *ParsingConfig) UpdateByCombainerConfig(config *CombainerConfig)

UpdateByCombainerConfig merge server config with parsing config

type PluginConfig

type PluginConfig map[string]interface{}

PluginConfig general description of any user-defined plugin configuration section

func (*PluginConfig) Class added in v1.8.1

func (p *PluginConfig) Class() (className string, err error)

Class check plugin config class

func (*PluginConfig) GetBool added in v1.8.0

func (p *PluginConfig) GetBool(key string) (bool, error)

GetBool value if present or false

func (*PluginConfig) Type

func (p *PluginConfig) Type() (typeName string, err error)

Type check plugin config type

Jump to

Keyboard shortcuts

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