Documentation
¶
Overview ¶
Package agent provides the usulnet agent that runs on remote Docker hosts. It connects to the central gateway via NATS, receives commands, and reports events and inventory.
Package agent provides the executor wrapper for the usulnet agent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is the agent version (set at build time).
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is the usulnet agent that runs on Docker hosts.
type Config ¶
type Config struct {
// AgentID is the unique identifier for this agent (generated if empty)
AgentID string `yaml:"agent_id"`
// Token is the authentication token for the gateway
Token string `yaml:"token"`
// GatewayURL is the NATS server URL
GatewayURL string `yaml:"gateway_url"`
// DockerHost is the Docker daemon address (default: unix:// + configured socket path)
DockerHost string `yaml:"docker_host"`
// Hostname is the agent's hostname (auto-detected if empty)
Hostname string `yaml:"hostname"`
// Labels are custom labels for this agent
Labels map[string]string `yaml:"labels"`
// LogLevel is the logging level
LogLevel string `yaml:"log_level"`
// DataDir is the directory for local state storage
DataDir string `yaml:"data_dir"`
// BackupEnabled enables backup capabilities on this agent.
// Not exposed in the YAML schema; flipped by the gateway at runtime.
BackupEnabled bool `yaml:"-"`
// ScannerEnabled enables security scanning capabilities on this agent.
// Not exposed in the YAML schema; flipped by the gateway at runtime.
ScannerEnabled bool `yaml:"-"`
// TLS holds the NATS TLS settings (nested under tls: in YAML).
TLS TLSConfig `yaml:"tls"`
}
Config holds the agent configuration.
YAML tags make this struct directly unmarshalable from the agent's config file (cmd/usulnet-agent). Operator-facing keys (gateway_url, docker_host, log_level, …) are snake_case; the TLS sub-block is nested under tls: in YAML.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor wraps the command executor for the agent.
func NewExecutor ¶
NewExecutor creates a new executor wrapper.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package connection provides NATS connection management for the usulnet agent.
|
Package connection provides NATS connection management for the usulnet agent. |
|
Package executor provides command execution for the usulnet agent.
|
Package executor provides command execution for the usulnet agent. |
|
Package inventory provides Docker resource inventory collection for the agent.
|
Package inventory provides Docker resource inventory collection for the agent. |