status

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package status is the status behavior: the status summary of a node.

Index

Constants

This section is empty.

Variables

View Source
var Behavior = behavior.Register(behavior.Define(
	"status", "The status summary of a node",
	behavior.Node,
	behavior.API,
	behavior.Area(area.Node),
	behavior.CLI,
	behavior.Platform(behavior.PlatformLinux, newReader),
	behavior.Platform(behavior.PlatformDarwin, newReader),
	behavior.Requires(hostname.Behavior, uptime.Behavior, osb.Behavior,
		load.Behavior, memory.Behavior, disk.Behavior),
	behavior.Read("get", Get).
		Describe("Get the status summary of the host").
		Explain("Runs the get of the hostname, uptime, os, load, memory and disk "+
			"behaviors on the host, and answers with each. A read that fails is in "+
			"errors, as its name and its error, and the other fields still answer.").
		Example("An Ubuntu host", GetInput{},
			summary(osb.Release{Distribution: "ubuntu", Version: "24.04"}), linux...).
		Example("A Mac", GetInput{},
			summary(osb.Release{Distribution: "darwin", Version: "15.5"}), darwin...),
))

Behavior is the status summary of a node: the hostname, uptime, os, load, memory and disk reads in one call.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name        string        `json:"name"             doc:"The hostname of the host, as the hostname command prints it"`
	Uptime      uptime.Entry  `json:"uptime"           doc:"How long the host has run"`
	OSInfo      osb.Release   `json:"os_info"          doc:"The operating system"`
	LoadAverage load.Averages `json:"load_average"     doc:"The load averages of the host"`
	Memory      memory.Usage  `json:"memory"           doc:"The memory of the host"`
	Disks       []disk.Disk   `json:"disks"            doc:"Each local filesystem"`
	Errors      []string      `json:"errors,omitempty" doc:"Each read that failed, as name: error. The other fields still answer."`
}

Entry is the status summary of one host: what the hostname, uptime, os, load, memory and disk behaviors read.

func Get

func Get(
	ctx context.Context,
	p Provider,
	_ GetInput,
) (Entry, error)

Get is the status summary of the host.

type GetInput

type GetInput struct{}

GetInput takes nothing: the status is of the whole host.

type Provider

type Provider interface {
	Status(ctx context.Context) (Entry, error)
}

Provider reads the status summary of the host.

Directories

Path Synopsis
Package mocks holds the generated double of the status provider, for the methods' tests.
Package mocks holds the generated double of the status provider, for the methods' tests.

Jump to

Keyboard shortcuts

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