core

package
v0.0.0-...-16cb735 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check interface {
	// Name of the check
	Name() string
	// Description is the description of the check
	Description() string
	// Version of the monitor
	Version() string
	// Check the status of a service
	Perform() (Status, error)
	// Watch the status of a service continously
	Watch(update chan<- *ServiceStatus, stop <-chan bool, wg *sync.WaitGroup) error
	// Config is the configuration used for the monitor
	Config() MonitorConfiguration
}

Check is a monitoring unit that checks a service

type MonitorConfiguration

type MonitorConfiguration interface {
	// Validate validates the configuration
	Validate() []error
}

MonitorConfiguration is a configuration for a monitor check

type ServiceStatus

type ServiceStatus struct {
	Err    error
	Status Status
	Check  Check
}

type Status

type Status int
const (
	StatusUp Status = iota
	StatusTransitioningUp
	StatusTransitioningDown
	StatusDown
	StatusUnknown
)

func (Status) String

func (i Status) String() string

Jump to

Keyboard shortcuts

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