config

package
v0.0.0-...-cb5e7a6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 5 Imported by: 2

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
	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 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
	Authetication struct {
		Header string
		Value  string
	}
}

URLMonitorConfig represents each url monitor

Jump to

Keyboard shortcuts

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