results

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// Get returns the cached result for the endpoint.
	Get(endpointID string) (Result, bool)
	// Set sets the cached result for the endpoint.
	Set(endpointID string, result Result)
	// Remove clears the cached result for the endpoint.
	Remove(endpointID string)
}

Manager provides a probe results cache and channel of updates.

func NewManager

func NewManager(updates chan Update) Manager

NewManager creates and returns an empty results manager.

type Result

type Result int

Result is the type for probe results.

const (
	// Unknown is encoded as -1 (type Result)
	Unknown Result = iota - 1

	// Success is encoded as 0 (type Result)
	Success

	// Failure is encoded as 1 (type Result)
	Failure
)

func (Result) String

func (r Result) String() string

func (Result) ToPrometheusType

func (r Result) ToPrometheusType() float64

ToPrometheusType translates a Result to a form which is better understood by prometheus.

type Update

type Update struct {
	EndpointID string
	Result     Result
}

Update is an enum of the types of updates sent over the Updates channel.

Jump to

Keyboard shortcuts

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