config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: BSD-3-Clause Imports: 3 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 {
	NodeName string    `yaml:"node_name"`
	Hosts    []Host    `yaml:"hosts"`
	Monitors []Monitor `yaml:"monitors"`
}

Generated with: https://zhwt.github.io/yaml-to-go/

func ReadConfig

func ReadConfig(path string) Config

Read and parse a yaml config at path

type Host

type Host struct {
	Name string `yaml:"name"`
	URL  string `yaml:"url"`
}

type Monitor

type Monitor struct {
	Name                 string `yaml:"name"`
	Type                 string `yaml:"type"`
	Host                 string `yaml:"host"`
	Key                  string `yaml:"key"`
	Interval             int    `yaml:"interval"`
	Timeout              int    `yaml:"timeout,omitempty"`
	FilePath             string `yaml:"file_path,omitempty"`
	DownThreshold        int    `yaml:"down_threshold,omitempty"`
	SMTPHost             string `yaml:"smtp_host,omitempty"`
	SMTPPort             int    `yaml:"smtp_port,omitempty"`
	SMTPForceTLS         bool   `yaml:"smtp_force_tls,omitempty"`
	SMTPSenderAddress    string `yaml:"smtp_sender_address,omitempty"`
	SMTPRecipientAddress string `yaml:"smtp_recipient_address,omitempty"`
	SMTPUsername         string `yaml:"smtp_username,omitempty"`
	SMTPPassword         string `yaml:"smtp_password,omitempty"`
	IMAPHost             string `yaml:"imap_host,omitempty"`
	IMAPPort             int    `yaml:"imap_port,omitempty"`
	IMAPForceTLS         bool   `yaml:"imap_force_tls,omitempty"`
	IMAPUsername         string `yaml:"imap_username,omitempty"`
	IMAPPassword         string `yaml:"imap_password,omitempty"`
	MessageSubject       string `yaml:"message_subject,omitempty"`
	MessageBody          string `yaml:"message_body,omitempty"`
	ResponseSubject      string `yaml:"response_subject,omitempty"`
}

Jump to

Keyboard shortcuts

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