Documentation
¶
Overview ¶
Package runtime manages the Patchcord agent's lifecycle: opening its database, launching and supervising its installed plugins, binding its local HTTP API, and shutting everything down cleanly on cancellation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent supervises the agent's database, HTTP API and installed plugins for the duration of one run.
func NewAgent ¶
NewAgent opens and migrates the agent's database, launches and starts supervising its installed plugins, then binds its listen address and prepares its HTTP server. It returns an error if the database or the listen address cannot be set up; a plugin that fails to launch is logged and skipped, never fails agent startup (see plugins.Supervisor).
func (*Agent) Addr ¶
Addr returns the actual address the agent is listening on. It is only meaningful after NewAgent has succeeded.
type Config ¶
type Config struct {
// ListenAddr is the local address the HTTP API binds to, e.g. "127.0.0.1:7331".
ListenAddr string
// DataDir holds the agent's SQLite database, created if it doesn't exist.
DataDir string
// SecretsMasterKeyFile points to the file holding the base64 AES-256
// master key for the "file" secret store. Left empty, "file" secret
// references simply don't resolve on this agent — see
// secrets.BuildStore and ADR-0040.
SecretsMasterKeyFile string
// ShutdownTimeout bounds how long in-flight requests are given to
// complete once shutdown starts. Defaults to 10s when zero.
ShutdownTimeout time.Duration
}
Config holds the settings needed to run the agent.