daemon

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireLock added in v0.2.0

func AcquireLock(dataDir, addr string) (func(), error)

AcquireLock records that this process owns dataDir as the control daemon and returns a release func to remove the lock on shutdown. A stale lock (its pid is gone) is overwritten. The lock is advisory: it powers WarnIfDaemonActive so direct CLI writes can surface the two-writer hazard, not a hard mutex.

func WarnIfDaemonActive added in v0.2.0

func WarnIfDaemonActive(dataDir string, w io.Writer)

WarnIfDaemonActive prints a stderr warning when a live daemon owns dataDir, so a direct CLI write knows it may diverge from the daemon's in-memory state. It never blocks the command (WAL keeps the file safe; the risk is logical).

Types

type Client

type Client struct {
	BaseURL string
	HTTP    *http.Client
	Token   string
}

func NewClient

func NewClient(baseURL string) Client

func (Client) CreateLease

func (c Client) CreateLease(task string) (string, error)

func (Client) CreateSession

func (c Client) CreateSession(leaseID string) (string, error)

func (Client) CreateSnapshot

func (c Client) CreateSnapshot(sessionID, typ, path, name string) (SnapshotCreateResponse, error)

func (Client) EvidenceManifest

func (c Client) EvidenceManifest(runID string, materialize bool) (evidence.MaterializedManifest, error)

func (Client) Exec

func (c Client) Exec(sessionID string, command []string, stream bool, out io.Writer) (string, error)

func (Client) ExplainGraph

func (Client) ExportBatchForensics

func (c Client) ExportBatchForensics(opts forensics.BatchExportOptions) (forensics.BatchBundleInfo, error)

func (Client) ExportForensics

func (c Client) ExportForensics(runID string) (forensics.BundleInfo, error)

func (Client) GraphLens added in v0.4.0

func (Client) ImportSignals

func (c Client) ImportSignals(runID, engine string, signals []signal.EvalSignal) (signal.EvalReport, error)

func (Client) InspectSession

func (c Client) InspectSession(sessionID string) (control.SessionInfo, error)

func (Client) ListSessions

func (c Client) ListSessions() ([]control.SessionInfo, error)

func (Client) ObserveSummary

func (c Client) ObserveSummary(runID string, topN int) (observability.Summary, error)

func (Client) RemoveSession

func (c Client) RemoveSession(sessionID string) error

func (Client) ResumeSnapshot

func (c Client) ResumeSnapshot(snapshotNameOrID, leaseID string) (string, error)

func (Client) RunBuiltinSignals

func (c Client) RunBuiltinSignals(runID string) (signal.EvalReport, error)

func (Client) SecurityDeviations

func (c Client) SecurityDeviations(runID string) (baseline.DeviationsReport, error)

func (Client) SecurityResponses

func (c Client) SecurityResponses(runID string) (securitymodel.ResponseActionsReport, error)

func (Client) SecurityRisks

func (c Client) SecurityRisks(runID string) (securitymodel.RiskSignalsReport, error)

func (Client) SetSessionCPUProfile

func (c Client) SetSessionCPUProfile(sessionID, profile string) error

func (Client) SignalContext

func (c Client) SignalContext(runID string) (signal.EvalContext, error)

func (Client) StopSession

func (c Client) StopSession(sessionID string) error

func (Client) TelemetryCorrelations

func (c Client) TelemetryCorrelations(runID, eventID string) (telemetry.CorrelationReport, error)

func (Client) Timeline

func (Client) VerifyGraph

func (c Client) VerifyGraph(runID string) (provenance.VerifyResult, error)

type LockInfo added in v0.2.0

type LockInfo struct {
	PID       int    `json:"pid"`
	Addr      string `json:"addr"`
	StartedAt string `json:"started_at"`
}

LockInfo records which process owns a data dir as the control daemon.

func ActiveLock added in v0.2.0

func ActiveLock(dataDir string) (LockInfo, bool)

ActiveLock returns the lock info if a live daemon currently owns dataDir.

type Server

type Server struct {
	DB               *sql.DB
	Paths            store.Paths
	Driver           runtimeplane.Driver
	SampleInterval   time.Duration
	SampleLimit      int
	SampleTimeout    time.Duration
	RawRetention     time.Duration
	MaxRawSamples    int
	EvidenceInterval time.Duration
	EvidenceLimit    int
	SpoolInterval    time.Duration
	SpoolLimit       int
	SpoolMaxQueued   int
	SpoolDropPolicy  string
	GCInterval       time.Duration
	GCLimit          int
	// AuthToken, when set, requires every request except GET /v1/health to carry
	// `Authorization: Bearer <AuthToken>`. Empty = open (backward compatible).
	AuthToken string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(dataDir string) (Server, func(), error)

func (Server) Handler

func (s Server) Handler() http.Handler

func (Server) StartEvidenceWorker

func (s Server) StartEvidenceWorker(ctx context.Context)

func (Server) StartGCWorker

func (s Server) StartGCWorker(ctx context.Context)

func (Server) StartSampler

func (s Server) StartSampler(ctx context.Context)

func (Server) StartSpoolWorker

func (s Server) StartSpoolWorker(ctx context.Context)

type SnapshotCreateResponse

type SnapshotCreateResponse struct {
	SnapshotID       string `json:"snapshot_id"`
	Files            int64  `json:"files"`
	Bytes            int64  `json:"bytes"`
	SnapshotCreateMS int64  `json:"snapshot_create_ms"`
	Hash             string `json:"hash"`
}

Jump to

Keyboard shortcuts

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