compliance

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Run

type Run struct {
	ID         int64           `json:"id"`
	InstanceID string          `json:"instance_id"`
	Project    string          `json:"project"`
	Contract   string          `json:"contract"`
	Pass       bool            `json:"pass"`
	Violations json.RawMessage `json:"violations"`
	RunAt      time.Time       `json:"run_at"`
}

Run represents a single compliance check result.

type Scheduler

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

Scheduler periodically validates active agents against their contracts.

func New

func New(db *sql.DB, instanceReg *instances.Registry, specReg *specs.Registry, eventBus *events.Bus, interval time.Duration, logger *slog.Logger) *Scheduler

New creates a new compliance Scheduler.

func (*Scheduler) History

func (s *Scheduler) History(ctx context.Context, instanceID string, limit int) ([]Run, error)

History returns recent compliance runs, optionally filtered by instance_id.

func (*Scheduler) RunAll

func (s *Scheduler) RunAll(ctx context.Context) []Run

RunAll validates all active instances against their project contracts. Returns the list of runs performed.

func (*Scheduler) Start

func (s *Scheduler) Start()

Start launches the background compliance check goroutine.

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop shuts down the scheduler.

Jump to

Keyboard shortcuts

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