probes

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package probes provides API to implement goma probes.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("probe not found")
)

Errors for probes.

Functions

func Register

func Register(name string, ctor Constructor)

Register registers a constructor of a kind of probes.

Types

type Constructor

type Constructor func(params map[string]interface{}) (Prober, error)

Constructor is a function to create a probe.

params are configuration options for the probe.

type Prober

type Prober interface {
	// Probe implements a probing method.
	//
	// The returned float64 value will be interpreted by the monitor
	// who run the probe.  Errors occurring within the probe should
	// produce a float64 value indicating the error.
	//
	// ctx.Deadline() is always set.
	// Probe must return immediately when the ctx.Done() is closed.
	// The return value will not be used in such cases.
	Probe(ctx context.Context) float64

	// String returns a descriptive string for this probe.
	String() string
}

Prober is the interface for probes.

func Construct

func Construct(name string, params map[string]interface{}) (Prober, error)

Construct constructs a named probe. This function is used internally in goma.

Directories

Path Synopsis
Package all import all probes to be compiled-in.
Package all import all probes to be compiled-in.
Package exec implements "exec" probe type that runs an arbitrary command.
Package exec implements "exec" probe type that runs an arbitrary command.
Package http implements "http" probe type that test HTTP(S) servers.
Package http implements "http" probe type that test HTTP(S) servers.
Package mysql implements "mysql" probe type that test MySQL servers.
Package mysql implements "mysql" probe type that test MySQL servers.

Jump to

Keyboard shortcuts

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