config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoggingConfig added in v0.3.2

func NewLoggingConfig() zapwriter.Config

func PrintDefaultConfig added in v0.3.2

func PrintDefaultConfig() error

PrintConfig ...

Types

type Carbonlink struct {
	Server         string    `toml:"server"`
	Threads        int       `toml:"threads-per-request"`
	Retries        int       `toml:"-"`
	ConnectTimeout *Duration `toml:"connect-timeout"`
	QueryTimeout   *Duration `toml:"query-timeout"`
	TotalTimeout   *Duration `toml:"total-timeout"`
}

type ClickHouse

type ClickHouse struct {
	Url                  string    `toml:"url"`
	DataTable            string    `toml:"data-table"`
	DataTimeout          *Duration `toml:"data-timeout"`
	TreeTable            string    `toml:"tree-table"`
	DateTreeTable        string    `toml:"date-tree-table"`
	DateTreeTableVersion int       `toml:"date-tree-table-version"`
	TaggedTable          string    `toml:"tagged-table"`
	ReverseTreeTable     string    `toml:"reverse-tree-table"`
	TreeTimeout          *Duration `toml:"tree-timeout"`
	TagTable             string    `toml:"tag-table"`
	RollupConf           string    `toml:"rollup-conf"`
	ExtraPrefix          string    `toml:"extra-prefix"`
}

type Common

type Common struct {
	Listen string `toml:"listen"`
	// MetricPrefix   string    `toml:"metric-prefix"`
	// MetricInterval *Duration `toml:"metric-interval"`
	// MetricEndpoint string    `toml:"metric-endpoint"`
	MaxCPU          int              `toml:"max-cpu"`
	TargetBlacklist []string         `toml:"target-blacklist"`
	Blacklist       []*regexp.Regexp `toml:"-"` // compiled TargetBlacklist
}

type Config

type Config struct {
	Common     Common             `toml:"common"`
	ClickHouse ClickHouse         `toml:"clickhouse"`
	DataTable  []DataTable        `toml:"data-table"`
	Tags       Tags               `toml:"tags"`
	Carbonlink Carbonlink         `toml:"carbonlink"`
	Logging    []zapwriter.Config `toml:"logging"`
	Rollup     *rollup.Rollup     `toml:"-"`
}

Config ...

func New

func New() *Config

NewConfig ...

func ReadConfig added in v0.3.2

func ReadConfig(filename string) (*Config, error)

ReadConfig ...

type DataTable added in v0.4.0

type DataTable struct {
	Table                string         `toml:"table"`
	Reverse              bool           `toml:"reverse"`
	MaxAge               *Duration      `toml:"max-age"`
	MinAge               *Duration      `toml:"min-age"`
	MaxInterval          *Duration      `toml:"max-interval"`
	MinInterval          *Duration      `toml:"min-interval"`
	TargetMatchAny       string         `toml:"target-match-any"`
	TargetMatchAll       string         `toml:"target-match-all"`
	TargetMatchAnyRegexp *regexp.Regexp `toml:"-"`
	TargetMatchAllRegexp *regexp.Regexp `toml:"-"`
}

type Duration

type Duration struct {
	time.Duration
}

Duration wrapper time.Duration for TOML

func (*Duration) MarshalText

func (d *Duration) MarshalText() ([]byte, error)

MarshalText encode text with TOML format

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText from TOML

func (*Duration) Value

func (d *Duration) Value() time.Duration

Value return time.Duration value

type Tags added in v0.3.0

type Tags struct {
	Rules      string `toml:"rules"`
	Date       string `toml:"date"`
	InputFile  string `toml:"input-file"`
	OutputFile string `toml:"output-file"`
}

Jump to

Keyboard shortcuts

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