monitors

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: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusUp   monitorStatus = "up"
	StatusDown monitorStatus = "down"
)

Variables

This section is empty.

Functions

func SetupMonitors

func SetupMonitors(c config.Config)

Schedule monitors to run in background

Types

type Monitor

type Monitor interface {
	// Name of this monitor (user defined in config)
	Name() string
	// Type of this monitor
	Type() string
	// Resolved host of this monitor
	HostURL() string
	// Key used to identify this monitor on the uptime host
	Key() string
	// Interval in seconds this monitor runs
	Interval() int

	// Run a single iteration of this monitor (periodically called)
	Run() (status monitorStatus, message string, pingMs int, err error)
}

Jump to

Keyboard shortcuts

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