Documentation
¶
Index ¶
- Constants
- type Job
- type RecoveryResult
- type Registry
- type Service
- func (s *Service) Execute(ctx context.Context, runID shared.ID) (vulnerabilitysync.Run, error)
- func (s *Service) ExecuteJob(ctx context.Context, jobID string) (vulnerabilitysync.Run, error)
- func (s *Service) FailJob(ctx context.Context, jobID string, cause error) error
- func (s *Service) GetRun(ctx context.Context, id shared.ID) (vulnerabilitysync.Run, error)
- func (s *Service) Health(ctx context.Context, source vulnerabilitysource.Source) (SourceHealth, error)
- func (s *Service) RecoverStale(ctx context.Context, stale vulnerabilitysync.Run, staleBefore time.Time) (RecoveryResult, error)
- func (s *Service) SetReconciler(reconciler ports.AdvisoryRevisionReconciler)
- func (s *Service) SetRollout(policy *vulnerabilityrollout.Policy)
- func (s *Service) Start(ctx context.Context, request StartRequest) (vulnerabilitysync.Run, bool, error)
- func (s *Service) StartAll(ctx context.Context, mode vulnerabilitysync.Mode, ...) ([]StartAllResult, error)
- type SourceHealth
- type SourceHealthState
- type StartAllResult
- type StartRequest
Constants ¶
const JobKind = "vulnerability_sync"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RecoveryResult ¶
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.
func (*Registry) Resolve ¶
func (r *Registry) Resolve(source vulnerabilitysource.Source) (ports.VulnerabilityIntelligenceProvider, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(sources ports.VulnerabilitySourceStore, runs ports.SyncRunStore, materializer ports.AdvisoryMaterializer, registry ports.VulnerabilityProviderRegistry, clock ports.Clock) (*Service, error)
func (*Service) Execute ¶
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 ¶
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) Health ¶
func (s *Service) Health(ctx context.Context, source vulnerabilitysource.Source) (SourceHealth, error)
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" )