types

package
v0.0.0-...-e0ff526 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: BSD-3-Clause Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Probe

type Probe struct {
	// URL is the HTTP URL to probe.
	URLs []string `json:"urls"`

	// Method is the HTTP method to use when probing.
	Method string `json:"method"`

	// Expected is the list of expected HTTP status code, i.e. [200, 201]
	Expected []int `json:"expected"`

	// Body is the body of the request to send if the method is POST.
	Body string `json:"body,omitempty"`

	// The mimetype of the Body.
	MimeType string `json:"mimetype"`

	// The body testing function we should use.
	ResponseTestName string `json:"responsetest,omitempty"`

	// If true, attach an OAuth 2.0 Bearer Token to the request.
	Authenticated bool `json:"authenticated,omitempty"`

	ResponseTest ResponseTester `json:"-"`

	//      map[url]metric.
	Failure map[string]metrics2.Int64Metric `json:"-"`
	Latency map[string]metrics2.Int64Metric `json:"-"` // Latency in ms.

	// Note is some comment about this prober.
	Note string `json:"note,omitempty"`
}

Probe is a single endpoint we are probing.

type Probes

type Probes map[string]*Probe

Probes is all the probes that are to be run.

func LoadFromJSONFile

func LoadFromJSONFile(filename string) (Probes, error)

LoadFromJSONFile loads the configuration of the probers from the given JSON file.

type ResponseTester

type ResponseTester func(io.Reader, http.Header) bool

ResponseTester tests the response from a probe and returns true if it passes all tests.

Directories

Path Synopsis
Program to generate JSON Schema definitions for the Probe struct.
Program to generate JSON Schema definitions for the Probe struct.

Jump to

Keyboard shortcuts

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