Documentation
¶
Overview ¶
Package daemon manages the Vela watch daemon lifecycle: PID file management, process detection, start/stop/status operations, and service installation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyRunning = errors.New("daemon is already running")
ErrAlreadyRunning is returned when a start operation finds a daemon already running.
var ErrNotRunning = errors.New("daemon is not running")
ErrNotRunning is returned when a stop/status operation finds no running daemon.
Functions ¶
func InstallService ¶
InstallService installs the Vela watch daemon as a system service. On Linux it creates a systemd user unit; on macOS a launchd plist.
func ServiceInstalled ¶ added in v1.2.0
func ServiceInstalled() bool
ServiceInstalled reports whether the user-level service definition exists on the current platform.
func SetConfigLoader ¶
SetConfigLoader registers the function the daemon uses to reload config on SIGHUP. Call this before daemon.Start(). Keeps daemon package free of a direct import on internal/config (avoids circular dependency risk).
func UninstallService ¶
func UninstallService() error
UninstallService removes the installed system service.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon orchestrates the Vela watch subsystem: it manages listener lifecycle, feeds events through the reconciler pipeline, and drives LLM extraction.
func New ¶
New creates a Daemon from the provided configuration and graph. The graph is patched in-place as events arrive.
func (*Daemon) SetGraphPath ¶ added in v1.3.0
SetGraphPath sets the path where the daemon will persist graph.json. Call this before daemon.Start(). When empty, graph persistence is skipped.
func (*Daemon) Start ¶
Start launches the daemon. It returns ErrAlreadyRunning if a daemon is already running (PID file exists and process is alive).
type PIDFile ¶
type PIDFile struct {
// contains filtered or unexported fields
}
PIDFile manages a file that stores the PID of the running daemon.
func NewPIDFile ¶
NewPIDFile creates a PIDFile for the given path. The directory is created if it does not exist.
func (*PIDFile) IsAlive ¶
IsAlive returns true if the recorded PID corresponds to a running process.
func (*PIDFile) Read ¶
Read returns the PID stored in the file. Returns ErrNotRunning if the file does not exist.