host

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 12 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 host answers what the sensor is running on: the compute kind, the ARN of the resource when one can be read, the kernel, and a stable sensor key kept on disk so a restart re-registers the same sensor.

Every probe is bounded by a short timeout and fails to "unknown" rather than blocking start-up: a sensor that cannot tell it is on EC2 still runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SensorKey

func SensorKey(dir string) (string, error)

SensorKey returns the key stored in dir, creating it on first run. The key is random, not derived from the host, so nothing about the machine is in it.

Types

type Env

type Env func(string) string

Env reads environment variables; os.Getenv outside tests.

type Facts

type Facts struct {
	ComputeKind   string
	ResourceArn   string
	Hostname      string
	KernelVersion string
}

Facts is what the sensor reports about where it runs.

func Probe

func Probe(ctx context.Context, env Env, root string, client *http.Client) Facts

Probe gathers Facts. root is the filesystem to read (normally "/").

Jump to

Keyboard shortcuts

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