config

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	TLSEnabled bool   `json:"tls_enabled"`
	CACert     string `json:"ca_cert"`
	ClientCert string `json:"client_cert"`
	ClientKey  string `json:"client_key"`
	ServerName string `json:"server_name"`
}

type Config

type Config struct {
	ElasticSearch *ESConfig         `json:"elasticsearch"`
	Distributed   bool              `json:"distributed"`
	Consul        map[string]string `json:"consul"`
	Rules         []*RuleConfig     `json:"-"`
}

func ParseConfig

func ParseConfig() (*Config, error)

func (*Config) NewESClient

func (c *Config) NewESClient() (*http.Client, error)

type DistributedConfig

type DistributedConfig struct {
	ConsulAddr    string `json:"consul_address"`
	ConsulLockKey string `json:"consul_lock_key"`
}

type ESConfig

type ESConfig struct {
	Server *ServerConfig `json:"server"`
	Client *ClientConfig `json:"client"`
}

type OutputConfig

type OutputConfig struct {
	Type   string                 `json:"type"`
	Config map[string]interface{} `json:"config"`
}

type RuleConfig

type RuleConfig struct {
	Name                 string                 `json:"name"`
	ElasticSearchIndex   string                 `json:"index"`
	CronSchedule         string                 `json:"schedule"`
	BodyField            string                 `json:"body_field"`
	ElasticSearchBodyRaw interface{}            `json:"body"`
	ElasticSearchBody    map[string]interface{} `json:"-"`
	Filters              []string               `json:"filters"`
	Outputs              []*OutputConfig        `json:"outputs"`
}

func ParseRules added in v0.0.13

func ParseRules() ([]*RuleConfig, error)

type ServerConfig

type ServerConfig struct {
	ElasticSearchURL string `json:"url"`
}

Jump to

Keyboard shortcuts

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