probes

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 7 Imported by: 1

README

probes

Package probes provides some probe implementations.

See docs at http://hkjn.me/probes.

Documentation

Overview

Package probes provides some probe implementations.

This package defines some helpers to send alert emails, while actual probes are defined in subpackages.

It uses sendgrid.com to send emails, which seems quite reliable, cheap and easy to use. You need an account with sengrid.com with user/password to use this package.

To send alert emails, at minimum the following configuration is required:

  • Config.SendGrid: sendgrid credentials
  • Config.Alert.Recipient: who receives the emails

Index

Constants

This section is empty.

Variables

View Source
var Config = EmailConfig{TemplateName: "email"}

Config is the email configuration.

Functions

func SendAlertEmail

func SendAlertEmail(name, desc string, badness int, records prober.Records) error

SendAlertEmail sends an alert email using SendGrid.

This is provided to simplify prober.Probe implementations for Alert().

Types

type EmailConfig

type EmailConfig struct {
	// Template for HTML email. See EmailData for what's passed to the
	// template when an alert email is generated.
	Template     string
	TemplateName string // name of the template
	Alert        struct {
		Sender    string   // From: address
		Recipient string   // To: address
		CCs       []string // CC: addresses
	}
	SendgridToken string // sendgrid token
}

EmailConfig describes the structure of the email configuration.

type EmailData

type EmailData struct {
	Name, Desc string
	Badness    int
	Records    prober.Records
}

EmailData describes the data available in EmailConfig.Template.

Directories

Path Synopsis
Package dnsprobe implements a DNS probe.
Package dnsprobe implements a DNS probe.
Package tcpprobe implements a TCP probe.
Package tcpprobe implements a TCP probe.
Package varsprobe implements a probe for /vars, i.e.
Package varsprobe implements a probe for /vars, i.e.
Package webprobe implements a HTTP probe.
Package webprobe implements a HTTP probe.

Jump to

Keyboard shortcuts

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