config

package
v0.0.0-...-20583e8 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server struct {
		Port     int
		Endpoint string
	}
	Checker struct {
		Interval int
		Timeout  int
	}
	URLMonitors []URLMonitorConfig
	Slack       SlackConfig
	Telegram    TelegramConfig
	Twilio      TwilioConfig
}

Config represents configuration set for the program to run

func CreateConfigurationFromFile

func CreateConfigurationFromFile(configFile string) (Config, error)

CreateConfigurationFromFile Returns a new configuration loaded from a file

type SlackConfig

type SlackConfig struct {
	Enabled    bool
	WebhookURL string
	Messages   SlackMessagesConfig
}

type SlackMessagesConfig

type SlackMessagesConfig struct {
	Healthy   string
	Unhealthy string
}

type TelegramConfig

type TelegramConfig struct {
	Enabled  bool
	Token    string
	ChatId   int64
	Messages TelegramMessagesConfig
}

type TelegramMessagesConfig

type TelegramMessagesConfig struct {
	Healthy   string
	Unhealthy string
}

type TwilioConfig

type TwilioConfig struct {
	SMS TwilioSMSConfig
}

type TwilioSMSBodyConfig

type TwilioSMSBodyConfig struct {
	Healthy   string
	Unhealthy string
}

type TwilioSMSConfig

type TwilioSMSConfig struct {
	Enabled    bool
	AccountSID string
	AuthToken  string
	From       string
	To         []string
	Body       TwilioSMSBodyConfig
	Timeout    int
}

type URLMonitorConfig

type URLMonitorConfig struct {
	URL  string
	Name string
}

URLMonitorConfig represents each url monitor

Jump to

Keyboard shortcuts

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