config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 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 API

type API struct {
	Address string `json:"address" yaml:"address"`
}

type BasicAuth

type BasicAuth struct {
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
}

type ChannelSlack

type ChannelSlack struct {
	Name                 string `json:"name" yaml:"name"`
	Token                string `json:"token" yaml:"token"`
	Channel              string `json:"channel" yaml:"channel"`
	MessagePrefixSuccess string `json:"message_prefix_success" yaml:"message_prefix_success"`
	MessagePrefixError   string `json:"message_prefix_error" yaml:"message_prefix_error"`
}

func (*ChannelSlack) Validate

func (cfg *ChannelSlack) Validate() error

type Channels

type Channels struct {
	Slack []ChannelSlack `json:"slack" yaml:"slack"`
}

type Config

type Config struct {
	Scripts     Scripts     `json:"scripts" yaml:"scripts"`
	DataSources DataSources `json:"datasources" yaml:"datasources"`
	Channels    Channels    `json:"channels" yaml:"channels"`
	Global      Global      `json:"global" yaml:"global"`
}

func New

func New() *Config

func (*Config) Init

func (cfg *Config) Init(configSource string) error

func (*Config) Validate

func (cfg *Config) Validate() error

type DataSourceClickhouse

type DataSourceClickhouse struct {
	Name        string `json:"name" yaml:"name"`
	Host        string `json:"host" yaml:"host"`
	Port        int    `json:"port" yaml:"port"`
	Username    string `json:"username" yaml:"username"`
	Password    string `json:"password" yaml:"password"`
	Database    string `json:"database" yaml:"database"`
	SSLMode     string `json:"ssl_mode" yaml:"ssl_mode"`
	SSLCertPath string `json:"ssl_cert_path" yaml:"ssl_cert_path"`
}

func (*DataSourceClickhouse) Validate

func (cfg *DataSourceClickhouse) Validate() error

type DataSourcePostgres

type DataSourcePostgres struct {
	Name        string `json:"name" yaml:"name"`
	Host        string `json:"host" yaml:"host"`
	Port        int    `json:"port" yaml:"port"`
	Username    string `json:"username" yaml:"username"`
	Password    string `json:"password" yaml:"password"`
	Database    string `json:"database" yaml:"database"`
	SSLMode     string `json:"ssl_mode" yaml:"ssl_mode"`
	SSLCertPath string `json:"ssl_cert_path" yaml:"ssl_cert_path"`
}

type DataSourcePrometheus

type DataSourcePrometheus struct {
	Name      string    `json:"name" yaml:"name"`
	URL       string    `json:"url" yaml:"url"`
	BasicAuth BasicAuth `json:"basic_auth" yaml:"basic_auth"`
}

func (*DataSourcePrometheus) Validate

func (cfg *DataSourcePrometheus) Validate() error

type DataSources

type DataSources struct {
	Clickhouse []DataSourceClickhouse `json:"clickhouse" yaml:"clickhouse"`
	Prometheus []DataSourcePrometheus `json:"prometheus" yaml:"prometheus"`
	Postgres   []DataSourcePostgres   `json:"postgres" yaml:"postgres"`
}

type Global

type Global struct {
	SendStartNotification []string `json:"send_start_notification" yaml:"send_start_notification"`
	SendStopNotification  []string `json:"send_stop_notification" yaml:"send_stop_notification"`
	API                   API      `json:"api" yaml:"api"`
}

type ScriptSourceFolder

type ScriptSourceFolder struct {
	UpdateInterval time.Duration `json:"update_interval" yaml:"update_interval"`
	Name           string        `json:"name" yaml:"name"`
	Path           string        `json:"path" yaml:"path"`
	Mask           string        `json:"mask" yaml:"mask"`
}

func (*ScriptSourceFolder) Validate

func (cfg *ScriptSourceFolder) Validate() error

type Scripts

type Scripts struct {
	Sources ScriptsSources `json:"sources" yaml:"sources"`
}

type ScriptsSources

type ScriptsSources struct {
	Folder []ScriptSourceFolder `json:"folder" yaml:"folder"`
}

Jump to

Keyboard shortcuts

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