clients

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 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 Canary

type Canary struct {
	Client
	// Key is the client's secret key.
	Key string
}

Canary sends a heartbeat pulse at intervals.

func NewCanary

func NewCanary(hostname string, interval int, key string) *Canary

NewCanary creates a new canary.

type Client

type Client struct {
	// ID from the database.
	ID int64
	// Hostname is used in alerts.
	Hostname string
	// Interval to expect check-ins in seconds (default 60, give or take 2).
	Interval int
	// LastCheck time.
	LastCheck time.Time
	// Failed is the time failures started if status is not OK.
	Failed time.Time
	// Status of the client.
	Status uint8
	// Acknowledgement of error status.
	Acknowledgement bool
	// Assignee of the acknowledged error.
	Assignee string
	// contains filtered or unexported fields
}

Client contains fields common to all watchers.

type Scout

type Scout struct {
	Client
	// Port of the client. Assumes standard HTTPS if unspecified.
	Port int
	// Tries made so far.
	Tries uint8
}

Scout configuration.

func NewScout

func NewScout(hostname string, port int, interval int) *Scout

NewScout creates a new scout.

func (*Scout) Start

func (c *Scout) Start()

Start the checker.

func (*Scout) Stop

func (c *Scout) Stop()

Stop the checker.

Jump to

Keyboard shortcuts

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