vulnerabilitymonitor

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const JobKind = "vulnerability_sync"

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	RunID    shared.ID `json:"run_id"`
	SourceID shared.ID `json:"source_id"`
}

type RecoveryResult

type RecoveryResult struct {
	StaleRunID shared.ID
	Run        vulnerabilitysync.Run
	Created    bool
	Disabled   bool
}

type Registry

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

Registry is an explicit code-owned provider registry. Registration is done by composition roots; runtime source configuration cannot upload executable code.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Register

func (r *Registry) Register(provider ports.VulnerabilityIntelligenceProvider) error

func (*Registry) RegisterFactory

func (r *Registry) RegisterFactory(adapterType string, factory ports.VulnerabilityProviderFactory) error

RegisterFactory registers one reviewed adapter constructor. A factory is resolved for every source execution so two source rows never share mutable endpoint, checkpoint, or client state.

type Service

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

func (*Service) Execute

func (s *Service) Execute(ctx context.Context, runID shared.ID) (vulnerabilitysync.Run, error)

Execute processes one queued/running run. Every materialized batch is committed before the run checkpoint advances. A canceled provider leaves the run running with the last committed checkpoint so the durable worker can retry it safely.

func (*Service) ExecuteJob

func (s *Service) ExecuteJob(ctx context.Context, jobID string) (vulnerabilitysync.Run, error)

ExecuteJob resolves the run from the durable queue row. The queue payload is intentionally opaque; the durable job id is the authoritative join key.

func (*Service) FailJob

func (s *Service) FailJob(ctx context.Context, jobID string, cause error) error

func (*Service) GetRun

func (s *Service) GetRun(ctx context.Context, id shared.ID) (vulnerabilitysync.Run, error)

func (*Service) Health

func (*Service) RecoverStale

func (s *Service) RecoverStale(ctx context.Context, stale vulnerabilitysync.Run, staleBefore time.Time) (RecoveryResult, error)

func (*Service) SetReconciler

func (s *Service) SetReconciler(reconciler ports.AdvisoryRevisionReconciler)

func (*Service) SetRollout

func (s *Service) SetRollout(policy *vulnerabilityrollout.Policy)

func (*Service) Start

func (s *Service) Start(ctx context.Context, request StartRequest) (vulnerabilitysync.Run, bool, error)

func (*Service) StartAll

func (s *Service) StartAll(ctx context.Context, mode vulnerabilitysync.Mode, trigger, actor, idempotencyPrefix string) ([]StartAllResult, error)

StartAll enqueues enabled, non-archived sources in deterministic key order. One source failure does not duplicate or roll back already accepted runs.

type SourceHealth

type SourceHealth struct {
	State            SourceHealthState      `json:"state"`
	Stale            bool                   `json:"stale"`
	LatestRun        *vulnerabilitysync.Run `json:"latest_run,omitempty"`
	LastSuccessfulAt *time.Time             `json:"last_successful_at,omitempty"`
	FreshUntil       *time.Time             `json:"fresh_until,omitempty"`
}

type SourceHealthState

type SourceHealthState string
const (
	SourceHealthArchived    SourceHealthState = "archived"
	SourceHealthDisabled    SourceHealthState = "disabled"
	SourceHealthSyncing     SourceHealthState = "syncing"
	SourceHealthNeverSynced SourceHealthState = "never_synced"
	SourceHealthHealthy     SourceHealthState = "healthy"
	SourceHealthStale       SourceHealthState = "stale"
	SourceHealthPartial     SourceHealthState = "partial"
	SourceHealthFailed      SourceHealthState = "failed"
)

type StartAllResult

type StartAllResult struct {
	SourceID shared.ID
	Run      vulnerabilitysync.Run
	Created  bool
	Err      error
}

type StartRequest

type StartRequest struct {
	SourceID             shared.ID
	Mode                 vulnerabilitysync.Mode
	Trigger              string
	Actor                string
	ClientIdempotencyKey string
}

Jump to

Keyboard shortcuts

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