check

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package check defines the interface for host check plugins.

Index

Constants

View Source
const DefaultTimeout = 60 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check interface {
	// Name returns the unique name of the check.
	Name() string

	// Description returns a human-readable description.
	Description() string

	// Run executes the check against the given hostname.
	Run(ctx context.Context, hostname string, cfg map[string]any) Result
}

Check is the interface that all plugins must implement.

type Result

type Result struct {
	Name            string       `json:"name"`
	Status          Status       `json:"status"`
	Message         string       `json:"message"`
	Details         []string     `json:"details,omitempty"`
	Duration        string       `json:"duration"`
	Tasks           []ResultTask `json:"tasks,omitempty"`
	AdditionalHosts []string     `json:"additional_hosts,omitempty"`
}

Result represents the outcome of a check.

type ResultTask

type ResultTask struct {
	CheckName string `json:"check_name"`
	Status    Status `json:"status"`
	Message   string `json:"message"`
}

type Status

type Status string

Status represents the result status of a check.

const (
	StatusPass    Status = "PASS"
	StatusFail    Status = "FAIL"
	StatusPartial Status = "PARTIAL"
	StatusWarn    Status = "WARN"
	StatusError   Status = "ERROR"
	StatusSkipped Status = "SKIPPED"
)

Jump to

Keyboard shortcuts

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