config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(filename string, cfg *Config) error

Parse ...

func Print

func Print(cfg interface{}) error

PrintConfig ...

Types

type ClickHouse

type ClickHouse struct {
	Url         string    `toml:"url"`
	DataTable   string    `toml:"data-table"`
	DataTimeout *Duration `toml:"data-timeout"`
	TreeTable   string    `toml:"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"`
}

type Config

type Config struct {
	Common     Common         `toml:"common"`
	ClickHouse ClickHouse     `toml:"clickhouse"`
	Tags       Tags           `toml:"tags"`
	Logging    Logging        `toml:"logging"`
	Rollup     *rollup.Rollup `toml:"-"`
}

Config ...

func New

func New() *Config

NewConfig ...

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 Logging

type Logging struct {
	File  string `toml:"file"`
	Level string `toml:"level"`
}

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