config

package
v0.0.0-...-63c5301 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBType

type DBType string
const (
	DBPostgres   DBType = "postgres"
	DBClickHouse DBType = "clickhouse"
)

type EnvConfig

type EnvConfig struct {
	IsDefault bool   `toml:"is_default"`
	Endpoint  string `toml:"endpoint"`
	Type      DBType `toml:"type"`
	Database  string `toml:"database"`
	User      string `toml:"user"`
	Password  string `toml:"password"`
	Include   string `toml:"include"`
}

func (EnvConfig) String

func (ec EnvConfig) String() string

type FlagConfig

type FlagConfig struct {
	Required    bool
	Default     *string
	Description string
	Type        FlagType
}

type FlagType

type FlagType string
const (
	FlagTimerange FlagType = "timerange"
)

type SelectorConfig

type SelectorConfig struct {
	Query       string                `toml:"query"`
	Flags       map[string]FlagConfig `toml:"flag"`
	Description string                `toml:"description"`
	Include     string                `toml:"include"`
	UseUTC      bool                  `toml:"use_utc"`
}

func (SelectorConfig) String

func (sc SelectorConfig) String() string

type SelektorConfig

type SelektorConfig struct {
	Selectors map[string]SelectorConfig `toml:"selector"`
	Envs      map[string]EnvConfig      `toml:"env"`
}

func ReadConfig

func ReadConfig(cfgPath string) (*SelektorConfig, error)

func (SelektorConfig) String

func (ec SelektorConfig) String() string

Jump to

Keyboard shortcuts

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