config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 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"`
	Metrics bool   `json:"metrics" yaml:"metrics"`
}

func (API) Validate added in v0.1.0

func (cfg API) Validate() error

type BasicAuth

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

type ChannelNotify added in v0.2.0

type ChannelNotify struct {
	Name  string             `json:"name" yaml:"name"`
	Icons ChannelNotifyIcons `json:"icons" yaml:"icons"`
}

func (ChannelNotify) Validate added in v0.2.0

func (cfg ChannelNotify) Validate() error

type ChannelNotifyIcons added in v0.2.0

type ChannelNotifyIcons struct {
	Success string `json:"success" yaml:"success"`
	Error   string `json:"error" yaml:"error"`
	Warning string `json:"warning" yaml:"warning"`
}

type ChannelSlack

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

func (ChannelSlack) Validate

func (cfg ChannelSlack) Validate() error

type ChannelSyslog added in v0.1.0

type ChannelSyslog struct {
	Name     string `json:"name" yaml:"name"`
	Tag      string `json:"tag" yaml:"tag"`
	Network  string `json:"network" yaml:"network"`
	Address  string `json:"address" yaml:"address"`
	Priority string `json:"priority" yaml:"priority"`
}

func (ChannelSyslog) Validate added in v0.1.0

func (cfg ChannelSyslog) Validate() error

type ChannelTelegram added in v0.1.0

type ChannelTelegram struct {
	Name    string        `json:"name" yaml:"name"`
	Token   string        `json:"token" yaml:"token"`
	ChatID  int64         `json:"chatId" yaml:"chatId"`
	Proxy   *ProxyConfig  `json:"proxy"`
	Timeout time.Duration `json:"timeout" yaml:"timeout"`
}

func (ChannelTelegram) Validate added in v0.1.0

func (cfg ChannelTelegram) Validate() error

type Channels

type Channels struct {
	Slack    []ChannelSlack    `json:"slack" yaml:"slack"`
	Telegram []ChannelTelegram `json:"telegram" yaml:"telegram"`
	Syslog   []ChannelSyslog   `json:"syslog" yaml:"syslog"`
	Notify   []ChannelNotify   `json:"notify" yaml:"notify"`
}

func (Channels) Validate added in v0.1.0

func (cfg Channels) Validate() error

type Config

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

func New

func New(configSource string) (*Config, 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"`
	SSLCertPath string        `json:"sslCertPath" yaml:"sslCertPath"`
	Timeout     time.Duration `json:"timeout" yaml:"timeout"`
}

func (DataSourceClickhouse) Validate

func (cfg DataSourceClickhouse) Validate() error

type DataSourceLoki added in v0.3.0

type DataSourceLoki struct {
	Name      string        `json:"name" yaml:"name"`
	URL       string        `json:"url" yaml:"url"`
	BasicAuth BasicAuth     `json:"basicAuth" yaml:"basicAuth"`
	Timeout   time.Duration `json:"timeout" yaml:"timeout"`
}

func (DataSourceLoki) Validate added in v0.3.0

func (cfg DataSourceLoki) Validate() error

type DataSourceMysql added in v0.1.0

type DataSourceMysql struct {
	Name    string        `json:"name" yaml:"name"`
	DSN     string        `json:"dsn" yaml:"dsn"`
	Timeout time.Duration `json:"timeout" yaml:"timeout"`
}

func (DataSourceMysql) Validate added in v0.1.0

func (cfg DataSourceMysql) 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:"sslMode" yaml:"sslMode"`
	SSLCertPath string        `json:"sslCertPath" yaml:"sslCertPath"`
	Timeout     time.Duration `json:"timeout" yaml:"timeout"`
}

func (DataSourcePostgres) Validate added in v0.1.0

func (cfg DataSourcePostgres) Validate() error

type DataSourcePrometheus

type DataSourcePrometheus struct {
	Name      string        `json:"name" yaml:"name"`
	URL       string        `json:"url" yaml:"url"`
	BasicAuth BasicAuth     `json:"basicAuth" yaml:"basicAuth"`
	Timeout   time.Duration `json:"timeout" yaml:"timeout"`
}

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"`
	MySQL      []DataSourceMysql      `json:"mysql" yaml:"mysql"`
	Loki       []DataSourceLoki       `json:"loki" yaml:"loki"`
}

func (DataSources) Validate added in v0.1.0

func (cfg DataSources) Validate() error

type Global

type Global struct {
	SendStartNotification []string       `json:"sendStartNotification" yaml:"sendStartNotification"`
	SendStopNotification  []string       `json:"sendStopNotification" yaml:"sendStopNotification"`
	API                   API            `json:"api" yaml:"api"`
	Storages              GlobalStorages `json:"storages" yaml:"storages"`
	LuaModulesPath        string         `json:"luaModulesPath" yaml:"luaModulesPath"`
}

func (Global) Validate added in v0.1.0

func (cfg Global) Validate() error

type GlobalStorages added in v0.2.0

type GlobalStorages struct {
	KV    string `json:"kv" yaml:"kv"`
	Alert string `json:"alert" yaml:"alert"`
}

func (*GlobalStorages) Validate added in v0.2.0

func (cfg *GlobalStorages) Validate() error

type ProxyAuthConfig added in v0.1.0

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

type ProxyConfig added in v0.1.0

type ProxyConfig struct {
	Address string           `json:"address" yaml:"address"`
	Auth    *ProxyAuthConfig `json:"auth" yaml:"auth"`
}

type ScriptSourceFolder

type ScriptSourceFolder struct {
	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 {
	UpdateInterval time.Duration  `json:"updateInterval" yaml:"updateInterval"`
	Sources        ScriptsSources `json:"sources" yaml:"sources"`
}

func (Scripts) Validate added in v0.1.0

func (cfg Scripts) Validate() error

type ScriptsSources

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

func (ScriptsSources) Validate added in v0.1.0

func (cfg ScriptsSources) Validate() error

type StorageCoreFile added in v0.2.0

type StorageCoreFile struct {
	Name    string        `json:"name" yaml:"name"`
	Path    string        `json:"path" yaml:"path"`
	Timeout time.Duration `json:"timeout" yaml:"timeout"`
}

func (StorageCoreFile) Validate added in v0.2.0

func (cfg StorageCoreFile) Validate() error

type StorageUploadS3 added in v0.2.0

type StorageUploadS3 struct {
	Name     string `json:"name" yaml:"name"`
	Region   string `json:"region" yaml:"region"`
	Key      string `json:"key" yaml:"key"`
	Secret   string `json:"secret" yaml:"secret"`
	Endpoint string `json:"endpoint" yaml:"endpoint"`
	Bucket   string `json:"bucket" yaml:"bucket"`
}

func (StorageUploadS3) Validate added in v0.2.0

func (cfg StorageUploadS3) Validate() error

type Storages added in v0.1.0

type Storages struct {
	Upload StoragesUpload `json:"upload" yaml:"upload"`
	Core   StoragesCore   `json:"core" yaml:"core"`
}

func (Storages) Validate added in v0.1.0

func (cfg Storages) Validate() error

type StoragesCore added in v0.2.0

type StoragesCore struct {
	File []StorageCoreFile `json:"file" yaml:"file"`
}

func (StoragesCore) Validate added in v0.2.0

func (cfg StoragesCore) Validate() error

type StoragesUpload added in v0.2.0

type StoragesUpload struct {
	S3 []StorageUploadS3 `json:"s3" yaml:"s3"`
}

func (StoragesUpload) Validate added in v0.2.0

func (cfg StoragesUpload) Validate() error

Jump to

Keyboard shortcuts

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