provider

package
v0.0.0-...-8102ba9 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package provider defines shared types for all provider implementations.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New("operation not supported on this OS family")

ErrUnsupported is returned by providers when an operation is not supported on the current OS family. The agent maps this to StatusSkipped instead of StatusFailed.

Functions

func WireProviderFacts

func WireProviderFacts(
	factsFn FactsFunc,
	providers ...any,
)

WireProviderFacts sets the facts function on all providers that support it. Providers that embed FactsAware automatically satisfy FactsSetter.

Types

type FactsAware

type FactsAware struct {
	// contains filtered or unexported fields
}

FactsAware provides facts access to providers via embedding. Embed this in any provider struct to gain access to agent facts:

type MyProvider struct {
    provider.FactsAware
    // ... other fields
}

func (*FactsAware) Facts

func (f *FactsAware) Facts() map[string]any

Facts returns the current agent facts, or nil if not available.

func (*FactsAware) SetFactsFunc

func (f *FactsAware) SetFactsFunc(
	fn FactsFunc,
)

SetFactsFunc sets the facts getter. Called after agent initialization to wire the provider to the agent's live facts.

type FactsFunc

type FactsFunc func() map[string]any

FactsFunc returns the current agent facts for use by providers. Called at execution time so providers always get the latest facts.

type FactsSetter

type FactsSetter interface {
	SetFactsFunc(fn FactsFunc)
}

FactsSetter is satisfied by any provider that embeds FactsAware. Used at wiring time to inject the facts function into all providers.

Directories

Path Synopsis
Package command provides command execution capabilities.
Package command provides command execution capabilities.
mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
container
docker
Package docker provides the Docker container management provider using the Docker Engine API.
Package docker provides the Docker container management provider using the Docker Engine API.
docker/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package file implements file deploy and status operations using NATS Object Store for content and KV for state tracking.
Package file implements file deploy and status operations using NATS Object Store for content and KV for state tracking.
mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
network
netinfo
Package netinfo provides network interface information.
Package netinfo provides network interface information.
netinfo/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
netplan
Package netplan provides shared helpers for writing Netplan configuration files with validation, rollback, and file-state tracking.
Package netplan provides shared helpers for writing Netplan configuration files with validation, rollback, and file-state tracking.
netplan/dns
Package dns provides DNS configuration management.
Package dns provides DNS configuration management.
netplan/dns/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
netplan/iface
Package iface provides network interface configuration management via Netplan.
Package iface provides network interface configuration management via Netplan.
netplan/iface/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
netplan/route
Package route provides network route configuration management via Netplan.
Package route provides network route configuration management via Netplan.
netplan/route/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
ping
Package ping provides network ping functionality.
Package ping provides network ping functionality.
ping/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
node
apt
Package apt provides package management operations via apt.
Package apt provides package management operations via apt.
apt/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
certificate
Package certificate provides CA certificate management operations.
Package certificate provides CA certificate management operations.
certificate/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
disk/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
host
Package host provides system host information.
Package host provides system host information.
host/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
load
Package load provides system load average statistics.
Package load provides system load average statistics.
load/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
log
Package log provides log viewing operations.
Package log provides log viewing operations.
log/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
mem
Package mem provides memory usage statistics.
Package mem provides memory usage statistics.
mem/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
ntp
Package ntp provides NTP server management via chrony.
Package ntp provides NTP server management via chrony.
ntp/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
power
Package power provides power management operations (reboot, shutdown).
Package power provides power management operations (reboot, shutdown).
power/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
process
Package process provides process management operations.
Package process provides process management operations.
process/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
service
Package service provides systemd service management operations.
Package service provides systemd service management operations.
service/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
sysctl
Package sysctl provides kernel parameter management via /etc/sysctl.d/.
Package sysctl provides kernel parameter management via /etc/sysctl.d/.
sysctl/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
timezone
Package timezone provides system timezone management via timedatectl.
Package timezone provides system timezone management via timedatectl.
timezone/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
user
Package user provides user and group management operations.
Package user provides user and group management operations.
user/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
scheduled
cron
Package cron provides management of cron drop-in files and periodic scripts.
Package cron provides management of cron drop-in files and periodic scripts.
cron/mocks
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.

Jump to

Keyboard shortcuts

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