config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 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) SetDefaults added in v0.1.0

func (cfg API) SetDefaults()

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) SetDefaults added in v0.2.0

func (cfg ChannelNotify) SetDefaults()

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) SetDefaults added in v0.1.0

func (cfg ChannelSlack) SetDefaults()

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) SetDefaults added in v0.1.0

func (cfg ChannelSyslog) SetDefaults()

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:"chat_id" yaml:"chat_id"`
	Proxy  *ProxyConfig `json:"proxy"`
}

func (ChannelTelegram) SetDefaults added in v0.1.0

func (cfg ChannelTelegram) SetDefaults()

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) SetDefaults added in v0.1.0

func (cfg Channels) SetDefaults()

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() *Config

func (*Config) Init

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

func (*Config) SetDefaults added in v0.1.0

func (cfg *Config) SetDefaults()

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:"ssl_cert_path" yaml:"ssl_cert_path"`
}

func (DataSourceClickhouse) SetDefaults added in v0.1.0

func (cfg DataSourceClickhouse) SetDefaults()

func (DataSourceClickhouse) Validate

func (cfg DataSourceClickhouse) Validate() error

type DataSourceMysql added in v0.1.0

type DataSourceMysql struct {
	Name string `json:"name" yaml:"name"`
	DSN  string `json:"dsn" yaml:"dsn"`
}

func (DataSourceMysql) SetDefaults added in v0.1.0

func (cfg DataSourceMysql) SetDefaults()

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:"ssl_mode" yaml:"ssl_mode"`
	SSLCertPath string `json:"ssl_cert_path" yaml:"ssl_cert_path"`
}

func (DataSourcePostgres) SetDefaults added in v0.1.0

func (cfg DataSourcePostgres) SetDefaults()

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:"basic_auth" yaml:"basic_auth"`
}

func (DataSourcePrometheus) SetDefaults added in v0.1.0

func (cfg DataSourcePrometheus) SetDefaults()

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"`
}

func (DataSources) SetDefaults added in v0.1.0

func (cfg DataSources) SetDefaults()

func (DataSources) Validate added in v0.1.0

func (cfg DataSources) Validate() error

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"`
}

func (Global) SetDefaults added in v0.1.0

func (cfg Global) SetDefaults()

func (Global) Validate added in v0.1.0

func (cfg Global) 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 {
	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) SetDefaults added in v0.1.0

func (cfg ScriptSourceFolder) SetDefaults()

func (ScriptSourceFolder) Validate

func (cfg ScriptSourceFolder) Validate() error

type Scripts

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

func (Scripts) SetDefaults added in v0.1.0

func (cfg Scripts) SetDefaults()

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) SetDefaults added in v0.1.0

func (cfg ScriptsSources) SetDefaults()

func (ScriptsSources) Validate added in v0.1.0

func (cfg ScriptsSources) Validate() error

type StorageS3 added in v0.1.0

type StorageS3 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 (StorageS3) SetDefaults added in v0.1.0

func (cfg StorageS3) SetDefaults()

func (StorageS3) Validate added in v0.1.0

func (cfg StorageS3) Validate() error

type Storages added in v0.1.0

type Storages struct {
	S3 []StorageS3 `json:"s3" yaml:"s3"`
}

func (Storages) SetDefaults added in v0.1.0

func (cfg Storages) SetDefaults()

func (Storages) Validate added in v0.1.0

func (cfg Storages) Validate() error

Jump to

Keyboard shortcuts

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