Documentation
¶
Overview ¶
Package memory provides in-memory repository implementations for the walking skeleton and tests. Replaced by the Postgres adapters.
Index ¶
- type AdvisoryStore
- type AgentSessionStore
- func (s *AgentSessionStore) AppendMessage(_ context.Context, sessionID shared.ID, seq int, m agent.Message) error
- func (s *AgentSessionStore) GetSession(_ context.Context, id shared.ID) (agent.Session, error)
- func (s *AgentSessionStore) ListByEngagement(_ context.Context, engagementID shared.ID) ([]agent.Session, error)
- func (s *AgentSessionStore) ListResumable(_ context.Context, staleFor time.Duration, now time.Time, limit int) ([]agent.Session, error)
- func (s *AgentSessionStore) Messages(_ context.Context, sessionID shared.ID) ([]agent.Message, error)
- func (s *AgentSessionStore) SaveSession(_ context.Context, sess agent.Session) error
- type ApprovalStore
- func (s *ApprovalStore) Decide(_ context.Context, d agent.ApprovalDecision) error
- func (s *ApprovalStore) EngagementsWithPending(_ context.Context) ([]shared.ID, error)
- func (s *ApprovalStore) Enqueue(_ context.Context, a agent.ProposedAction) error
- func (s *ApprovalStore) Get(_ context.Context, actionID shared.ID) (agent.ProposedAction, agent.ApprovalDecision, error)
- func (s *ApprovalStore) Pending(_ context.Context, engagementID shared.ID) ([]agent.ProposedAction, error)
- type CommentRepository
- type DecisionStore
- type EngagementRepository
- func (r *EngagementRepository) Create(_ context.Context, e *engagement.Engagement) error
- func (r *EngagementRepository) Delete(_ context.Context, id shared.ID) error
- func (r *EngagementRepository) GetByID(_ context.Context, id shared.ID) (*engagement.Engagement, error)
- func (r *EngagementRepository) GetByIDInTenant(_ context.Context, tenantID, id shared.ID) (*engagement.Engagement, error)
- func (r *EngagementRepository) GetByProjectID(_ context.Context, tenantID, projectID shared.ID) (*engagement.Engagement, error)
- func (r *EngagementRepository) List(_ context.Context, tenantID shared.ID) ([]*engagement.Engagement, error)
- func (r *EngagementRepository) ProjectContexts(_ context.Context, tenantID shared.ID, projectIDs []shared.ID) (map[shared.ID]*engagement.Engagement, error)
- func (r *EngagementRepository) Update(_ context.Context, e *engagement.Engagement) error
- type EvidenceStore
- type FindingRepository
- func (r *FindingRepository) ListByEngagement(_ context.Context, engagementID shared.ID) ([]finding.Finding, error)
- func (r *FindingRepository) ListPublishableByEngagement(ctx context.Context, engagementID shared.ID) ([]finding.Finding, error)
- func (r *FindingRepository) SetAssignee(_ context.Context, engagementID, findingID shared.ID, assignee string, ...) (finding.Finding, error)
- func (r *FindingRepository) SetEvidenceScore(_ context.Context, engagementID, findingID shared.ID, ...) (finding.Finding, error)
- func (r *FindingRepository) UpdateStatus(_ context.Context, engagementID, findingID shared.ID, status finding.Status, ...) (finding.Finding, error)
- func (r *FindingRepository) Upsert(_ context.Context, findings []finding.Finding) error
- type ImportedSBOMStore
- type JobQueue
- func (q *JobQueue) Claim(_ context.Context, visibility time.Duration, kinds ...string) (*ports.QueuedJob, error)
- func (q *JobQueue) Complete(_ context.Context, id string) error
- func (q *JobQueue) Deadletter(_ context.Context, id string) error
- func (q *JobQueue) Depth(_ context.Context, kinds ...string) (int, error)
- func (q *JobQueue) Enqueue(_ context.Context, kind string, payload []byte) (string, error)
- func (q *JobQueue) Fail(_ context.Context, id string, retryIn time.Duration) error
- func (q *JobQueue) Heartbeat(_ context.Context, id string, extend time.Duration) error
- type JudgmentStore
- func (s *JudgmentStore) ListByEngagement(_ context.Context, engagementID shared.ID) ([]judgment.Judgment, error)
- func (s *JudgmentStore) ListBySubject(_ context.Context, engagementID, subjectID shared.ID) ([]judgment.Judgment, error)
- func (s *JudgmentStore) Save(_ context.Context, j judgment.Judgment) error
- func (s *JudgmentStore) SetScoreState(_ context.Context, engagementID, id shared.ID, score int, state judgment.State, ...) (judgment.Judgment, error)
- type PlanStore
- type ProjectAnalysisStore
- func (s *ProjectAnalysisStore) CurrentAnalysisHotspotSummary(ctx context.Context, tenantID, projectID, analysisID shared.ID, ...) (hotspot.Summary, error)
- func (s *ProjectAnalysisStore) Get(_ context.Context, tenantID, projectID, analysisID shared.ID) (projectanalysis.Analysis, error)
- func (s *ProjectAnalysisStore) GetHotspot(ctx context.Context, tenantID, projectID, hotspotID shared.ID) (hotspot.Hotspot, error)
- func (s *ProjectAnalysisStore) GetIssue(ctx context.Context, tenantID, projectID, issueID shared.ID) (issue.Issue, error)
- func (s *ProjectAnalysisStore) HotspotHistory(ctx context.Context, tenantID, projectID, hotspotID shared.ID) ([]hotspot.ReviewEvent, error)
- func (s *ProjectAnalysisStore) IssueHistory(ctx context.Context, tenantID, projectID, issueID shared.ID) ([]issue.ReviewEvent, error)
- func (s *ProjectAnalysisStore) LatestForProjects(_ context.Context, tenantID shared.ID, projectIDs []shared.ID) (map[shared.ID]projectanalysis.Analysis, error)
- func (s *ProjectAnalysisStore) LatestWithResult(_ context.Context, tenantID, projectID shared.ID) (projectanalysis.Analysis, []byte, error)
- func (s *ProjectAnalysisStore) List(_ context.Context, tenantID, projectID shared.ID, limit int, ...) ([]projectanalysis.Analysis, bool, error)
- func (s *ProjectAnalysisStore) ListAnalysisHotspots(ctx context.Context, tenantID, projectID, analysisID shared.ID, ...) (hotspot.Page, hotspot.Summary, error)
- func (s *ProjectAnalysisStore) ListHotspots(ctx context.Context, tenantID, projectID shared.ID, filter hotspot.ListFilter) (hotspot.Page, error)
- func (s *ProjectAnalysisStore) ListIssues(ctx context.Context, tenantID, projectID shared.ID, filter issue.ListFilter) (issue.Page, error)
- func (s *ProjectAnalysisStore) ResolvedIssueKeys(ctx context.Context, tenantID, projectID shared.ID) (map[string]bool, error)
- func (s *ProjectAnalysisStore) Save(ctx context.Context, analysis projectanalysis.Analysis) error
- func (s *ProjectAnalysisStore) SaveWithResult(_ context.Context, analysis projectanalysis.Analysis, result []byte) error
- func (s *ProjectAnalysisStore) SaveWithResultAndHotspots(ctx context.Context, analysis projectanalysis.Analysis, result []byte, ...) error
- func (s *ProjectAnalysisStore) SaveWithResultAndProjections(_ context.Context, analysis projectanalysis.Analysis, result []byte, ...) error
- func (s *ProjectAnalysisStore) TransitionHotspot(ctx context.Context, cmd hotspot.TransitionCommand) (hotspot.Hotspot, hotspot.ReviewEvent, error)
- func (s *ProjectAnalysisStore) TransitionIssue(ctx context.Context, cmd issue.TransitionCommand) (issue.Issue, issue.ReviewEvent, error)
- type ProjectRepository
- func (r *ProjectRepository) AssignProfile(_ context.Context, tenantID shared.ID, projectKey, language, profileKey string) error
- func (r *ProjectRepository) CountByGate(_ context.Context, tenantID shared.ID, gateID string) (int, error)
- func (r *ProjectRepository) Create(_ context.Context, p *project.Project) error
- func (r *ProjectRepository) DeleteByKey(_ context.Context, tenantID shared.ID, key string) error
- func (r *ProjectRepository) GetByID(_ context.Context, tenantID, projectID shared.ID) (*project.Project, error)
- func (r *ProjectRepository) GetByKey(_ context.Context, tenantID shared.ID, key string) (*project.Project, error)
- func (r *ProjectRepository) List(_ context.Context, tenantID shared.ID) ([]*project.Project, error)
- func (r *ProjectRepository) UpdateGate(_ context.Context, tenantID shared.ID, key, gateID string) error
- type QualityGateMutator
- func (m *QualityGateMutator) AssignProjectGate(ctx context.Context, tenantID shared.ID, projectKey, gateID string, ...) error
- func (m *QualityGateMutator) CreateGate(ctx context.Context, tenantID shared.ID, gate qualitygate.Gate, ...) error
- func (m *QualityGateMutator) CreateProjectWithGate(ctx context.Context, p *project.Project) error
- func (m *QualityGateMutator) DeleteGate(ctx context.Context, tenantID shared.ID, key string, entry ports.AuditEntry) error
- func (m *QualityGateMutator) UpdateGate(ctx context.Context, tenantID shared.ID, gate qualitygate.Gate, ...) error
- type QualityGateStore
- func (s *QualityGateStore) Create(_ context.Context, tenantID shared.ID, gate qualitygate.Gate) error
- func (s *QualityGateStore) Delete(_ context.Context, tenantID shared.ID, key string) error
- func (s *QualityGateStore) DeleteIfUnassigned(ctx context.Context, tenantID shared.ID, key string) error
- func (s *QualityGateStore) Get(_ context.Context, tenantID shared.ID, key string) (qualitygate.Gate, error)
- func (s *QualityGateStore) List(_ context.Context, tenantID shared.ID) ([]qualitygate.Gate, error)
- func (s *QualityGateStore) Update(_ context.Context, tenantID shared.ID, gate qualitygate.Gate) error
- type QualityProfileStore
- func (s *QualityProfileStore) Create(_ context.Context, tenantID shared.ID, profile qualityprofile.Profile) error
- func (s *QualityProfileStore) Delete(_ context.Context, tenantID shared.ID, key string) error
- func (s *QualityProfileStore) Get(_ context.Context, tenantID shared.ID, key string) (qualityprofile.Profile, error)
- func (s *QualityProfileStore) List(_ context.Context, tenantID shared.ID) ([]qualityprofile.Profile, error)
- func (s *QualityProfileStore) Update(_ context.Context, tenantID shared.ID, profile qualityprofile.Profile) error
- type ReconRunRepository
- func (r *ReconRunRepository) Get(_ context.Context, id shared.ID) (recon.Run, error)
- func (r *ReconRunRepository) ListByEngagement(_ context.Context, engagementID shared.ID) ([]recon.Run, error)
- func (r *ReconRunRepository) ListStaleRunning(_ context.Context, olderThan time.Time, limit int) ([]recon.Run, error)
- func (r *ReconRunRepository) Save(_ context.Context, run recon.Run) error
- type RetestRepository
- type RunLock
- type ScanJobStore
- func (s *ScanJobStore) CreateRunning(_ context.Context, j ports.ScanJob) error
- func (s *ScanJobStore) GetJob(_ context.Context, id string) (ports.ScanJob, error)
- func (s *ScanJobStore) LatestForEngagement(_ context.Context, engagementID shared.ID) (ports.ScanJob, error)
- func (s *ScanJobStore) LatestForEngagements(_ context.Context, engagementIDs []shared.ID) (map[shared.ID]ports.ScanJob, error)
- func (s *ScanJobStore) ListStaleRunning(_ context.Context, olderThan time.Time, limit int) ([]ports.ScanJob, error)
- func (s *ScanJobStore) Save(_ context.Context, j ports.ScanJob) error
- type ScanRepository
- type ScanResultStore
- type ScanRunStore
- type ThreatModelStore
- type TimestampStore
- func (s *TimestampStore) Get(_ context.Context, chain string, eng shared.ID, head string) (*ports.TimestampToken, error)
- func (s *TimestampStore) LatestHead(_ context.Context, chain string, eng shared.ID) (string, bool, error)
- func (s *TimestampStore) Put(_ context.Context, chain string, eng shared.ID, head string, ...) error
- type UserRepository
- func (r *UserRepository) Create(_ context.Context, u *user.User) error
- func (r *UserRepository) GetByAPIKeyHash(_ context.Context, hash string) (*user.User, error)
- func (r *UserRepository) GetByID(_ context.Context, id shared.ID) (*user.User, error)
- func (r *UserRepository) List(_ context.Context) ([]*user.User, error)
- func (r *UserRepository) Upsert(_ context.Context, u *user.User) error
- type WriteupDraftStore
- func (s *WriteupDraftStore) Get(_ context.Context, engagementID, id shared.ID) (writeupdraft.Draft, error)
- func (s *WriteupDraftStore) ListByEngagement(_ context.Context, engagementID shared.ID) ([]writeupdraft.Draft, error)
- func (s *WriteupDraftStore) Save(_ context.Context, d writeupdraft.Draft) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvisoryStore ¶
type AdvisoryStore struct {
// contains filtered or unexported fields
}
AdvisoryStore is the in-memory owned-advisory store (dev/tests, mirrors the Postgres adapter). It is GLOBAL reference data – NOT tenant-scoped. Advisories are indexed by every affected (ecosystem, package) so ByPackage is a map lookup, and Upsert is idempotent by advisory id (re-syncable reference data, replaced in place – not append-only). The stored ecosystem+package keys are the ingester-normalized, OSV-canonical ids per the ports.AdvisoryStore KEY CONTRACT.
func NewAdvisoryStore ¶
func NewAdvisoryStore() *AdvisoryStore
NewAdvisoryStore returns an empty in-memory advisory store.
func (*AdvisoryStore) ByPackage ¶
func (s *AdvisoryStore) ByPackage(_ context.Context, ecosystem, name string) ([]advisory.Advisory, error)
ByPackage returns the advisories that list (ecosystem, name) as affected, in deterministic id order (matching the Postgres adapter's ORDER BY id COLLATE "C"); the caller runs advisory.Match to decide which actually hit the component's version.
type AgentSessionStore ¶
type AgentSessionStore struct {
// contains filtered or unexported fields
}
AgentSessionStore is the in-memory ports.AgentSessionStore (dev/tests). It keeps the same (session, seq) transcript fork-guard as the Postgres adapter so a duplicate seq is rejected, not silently overwritten.
func NewAgentSessionStore ¶
func NewAgentSessionStore() *AgentSessionStore
NewAgentSessionStore returns an empty in-memory agent session store.
func (*AgentSessionStore) AppendMessage ¶
func (*AgentSessionStore) GetSession ¶
func (*AgentSessionStore) ListByEngagement ¶
func (*AgentSessionStore) ListResumable ¶
func (*AgentSessionStore) SaveSession ¶
type ApprovalStore ¶
type ApprovalStore struct {
// contains filtered or unexported fields
}
ApprovalStore is the in-memory ports.ApprovalStore (dev/tests). Decide is idempotent: the first terminal decision wins; a second returns ErrConflict (so a double-click / race cannot re-open an admitted action).
func NewApprovalStore ¶
func NewApprovalStore() *ApprovalStore
NewApprovalStore returns an empty in-memory approval store.
func (*ApprovalStore) Decide ¶
func (s *ApprovalStore) Decide(_ context.Context, d agent.ApprovalDecision) error
func (*ApprovalStore) EngagementsWithPending ¶
func (*ApprovalStore) Enqueue ¶
func (s *ApprovalStore) Enqueue(_ context.Context, a agent.ProposedAction) error
func (*ApprovalStore) Get ¶
func (s *ApprovalStore) Get(_ context.Context, actionID shared.ID) (agent.ProposedAction, agent.ApprovalDecision, error)
func (*ApprovalStore) Pending ¶
func (s *ApprovalStore) Pending(_ context.Context, engagementID shared.ID) ([]agent.ProposedAction, error)
type CommentRepository ¶
type CommentRepository struct {
// contains filtered or unexported fields
}
CommentRepository is an in-memory per-finding comment thread (dev/tests).
func NewCommentRepository ¶
func NewCommentRepository() *CommentRepository
NewCommentRepository returns an empty in-memory comment repository.
func (*CommentRepository) ListByEngagementFinding ¶
type DecisionStore ¶
type DecisionStore struct {
// contains filtered or unexported fields
}
DecisionStore is the in-memory ports.DecisionStore (dev/tests). It mirrors the Postgres adapter: a monotonic per-session seq, idempotent on (session_id, action_id) for step decisions and a single stop per session (a re-record is a no-op, so a redelivered drive cannot fork the log).
func NewDecisionStore ¶
func NewDecisionStore() *DecisionStore
NewDecisionStore returns an empty in-memory decision store.
func (*DecisionStore) AppendDecision ¶
func (s *DecisionStore) AppendDecision(_ context.Context, d agent.AgentDecision) error
func (*DecisionStore) ListBySession ¶
func (s *DecisionStore) ListBySession(_ context.Context, sessionID shared.ID) ([]agent.AgentDecision, error)
type EngagementRepository ¶
type EngagementRepository struct {
// contains filtered or unexported fields
}
EngagementRepository is a goroutine-safe in-memory engagement store.
func NewEngagementRepository ¶
func NewEngagementRepository() *EngagementRepository
NewEngagementRepository returns an empty in-memory repository.
func (*EngagementRepository) Create ¶
func (r *EngagementRepository) Create(_ context.Context, e *engagement.Engagement) error
func (*EngagementRepository) Delete ¶
Delete removes an engagement (idempotent). In Postgres the FK cascade removes children; in memory other stores are independent, but import rollback only needs the engagement gone so a re-import isn't blocked.
func (*EngagementRepository) GetByID ¶
func (r *EngagementRepository) GetByID(_ context.Context, id shared.ID) (*engagement.Engagement, error)
func (*EngagementRepository) GetByIDInTenant ¶
func (r *EngagementRepository) GetByIDInTenant(_ context.Context, tenantID, id shared.ID) (*engagement.Engagement, error)
GetByIDInTenant loads an engagement scoped to tenantID. A caller tenant of ” matches any row; a non-empty tenant matches only its own – tenant A cannot read tenant B's engagement (ErrNotFound).
func (*EngagementRepository) GetByProjectID ¶
func (r *EngagementRepository) GetByProjectID(_ context.Context, tenantID, projectID shared.ID) (*engagement.Engagement, error)
func (*EngagementRepository) List ¶
func (r *EngagementRepository) List(_ context.Context, tenantID shared.ID) ([]*engagement.Engagement, error)
func (*EngagementRepository) ProjectContexts ¶
func (r *EngagementRepository) ProjectContexts(_ context.Context, tenantID shared.ID, projectIDs []shared.ID) (map[shared.ID]*engagement.Engagement, error)
func (*EngagementRepository) Update ¶
func (r *EngagementRepository) Update(_ context.Context, e *engagement.Engagement) error
type EvidenceStore ¶
type EvidenceStore struct {
// contains filtered or unexported fields
}
EvidenceStore is an in-memory append-only evidence ledger.
func NewEvidenceStore ¶
func NewEvidenceStore() *EvidenceStore
NewEvidenceStore returns an empty in-memory evidence store.
func (*EvidenceStore) ListByEngagement ¶
type FindingRepository ¶
type FindingRepository struct {
// contains filtered or unexported fields
}
FindingRepository is an in-memory finding store (dev/tests), deduped per engagement by dedup key. Replaced by Postgres when a DB is configured.
func NewFindingRepository ¶
func NewFindingRepository() *FindingRepository
NewFindingRepository returns an empty in-memory finding repository.
func (*FindingRepository) ListByEngagement ¶
func (r *FindingRepository) ListByEngagement(_ context.Context, engagementID shared.ID) ([]finding.Finding, error)
ListByEngagement returns the engagement's findings, highest risk first (KEV -> EPSS x CVSS).
func (*FindingRepository) ListPublishableByEngagement ¶
func (r *FindingRepository) ListPublishableByEngagement(ctx context.Context, engagementID shared.ID) ([]finding.Finding, error)
ListPublishableByEngagement returns only the engagement's findings that clear the evidence gate, reusing the single domain rule finding.Publishable.
func (*FindingRepository) SetAssignee ¶
func (r *FindingRepository) SetAssignee(_ context.Context, engagementID, findingID shared.ID, assignee string, expectedVersion int) (finding.Finding, error)
SetAssignee sets a finding's assignee with the same optimistic-concurrency guard.
func (*FindingRepository) SetEvidenceScore ¶
func (r *FindingRepository) SetEvidenceScore(_ context.Context, engagementID, findingID shared.ID, score, expectedVersion int) (finding.Finding, error)
SetEvidenceScore sets a finding's evidence score with the same optimistic-concurrency guard as UpdateStatus (the adversarial-verdict path). Returns shared.ErrConflict on a version mismatch, shared.ErrNotFound if absent.
func (*FindingRepository) UpdateStatus ¶
func (r *FindingRepository) UpdateStatus(_ context.Context, engagementID, findingID shared.ID, status finding.Status, expectedVersion int) (finding.Finding, error)
UpdateStatus sets a finding's triage status with optimistic concurrency (expectedVersion must match the stored version), bumping the version. Returns shared.ErrConflict on a version mismatch, shared.ErrNotFound if absent.
type ImportedSBOMStore ¶
type ImportedSBOMStore struct {
// contains filtered or unexported fields
}
ImportedSBOMStore keeps the active imported SBOM per engagement in memory.
func NewImportedSBOMStore ¶
func NewImportedSBOMStore() *ImportedSBOMStore
NewImportedSBOMStore returns an empty imported-SBOM store.
func (*ImportedSBOMStore) LatestByEngagement ¶
func (s *ImportedSBOMStore) LatestByEngagement(_ context.Context, tenantID, engagementID shared.ID) (importedsbom.Record, error)
LatestByEngagement returns a copy of the active imported SBOM.
func (*ImportedSBOMStore) SaveActive ¶
func (s *ImportedSBOMStore) SaveActive(_ context.Context, record importedsbom.Record) error
SaveActive stores a copy of the active imported SBOM for its engagement.
type JobQueue ¶
type JobQueue struct {
// contains filtered or unexported fields
}
JobQueue is an in-memory ports.JobQueue for dev/single-process + tests, with the same visibility-lease + reclaim semantics as the Postgres adapter (not durable across restarts). Time is injected so tests can exercise lease expiry deterministically.
func NewJobQueue ¶
func NewJobQueue(ids ports.IDGenerator, now func() time.Time) *JobQueue
NewJobQueue returns an in-memory job queue. now may be nil (uses time.Now).
func (*JobQueue) Depth ¶
Depth counts not-yet-terminal jobs (queued or claimed); 'done'/'failed' are excluded. Optional kind filter (empty = any). Mirrors the Postgres adapter.
type JudgmentStore ¶
type JudgmentStore struct {
// contains filtered or unexported fields
}
JudgmentStore is the in-memory judgment repository (dev/tests). It mirrors the Postgres adapter to come: SetScoreState is the ONLY score/state mover and is guarded by optimistic concurrency (expectedVersion → shared.ErrConflict on mismatch), the same discipline as the finding repo's SetEvidenceScore. The score mover is deliberately not exposed on a broad read port.
func NewJudgmentStore ¶
func NewJudgmentStore() *JudgmentStore
NewJudgmentStore returns an empty in-memory judgment store.
func (*JudgmentStore) ListByEngagement ¶
func (s *JudgmentStore) ListByEngagement(_ context.Context, engagementID shared.ID) ([]judgment.Judgment, error)
ListByEngagement returns a copy of the engagement's judgments.
func (*JudgmentStore) ListBySubject ¶
func (s *JudgmentStore) ListBySubject(_ context.Context, engagementID, subjectID shared.ID) ([]judgment.Judgment, error)
ListBySubject returns the engagement's judgments about a given subject id.
func (*JudgmentStore) Save ¶
Save inserts or replaces a judgment within its engagement (idempotent by id).
func (*JudgmentStore) SetScoreState ¶
func (s *JudgmentStore) SetScoreState(_ context.Context, engagementID, id shared.ID, score int, state judgment.State, expectedVersion int) (judgment.Judgment, error)
SetScoreState moves a judgment's score + state under optimistic concurrency. A version mismatch returns shared.ErrConflict (lost-update guard); an unknown id returns shared.ErrNotFound.
type PlanStore ¶
type PlanStore struct {
// contains filtered or unexported fields
}
PlanStore is the in-memory ports.PlanStore (dev/tests). It mirrors the Postgres adapter's contract: one plan per session, and SavePlan is an optimistic-concurrency CAS on the revision (a stale revision returns ErrConflict). Plans are deep-copied in and out so a caller mutating its own Plan value cannot retroactively change stored state.
func NewPlanStore ¶
func NewPlanStore() *PlanStore
NewPlanStore returns an empty in-memory plan store.
func (*PlanStore) CreatePlan ¶
func (*PlanStore) GetBySession ¶
type ProjectAnalysisStore ¶
type ProjectAnalysisStore struct {
// contains filtered or unexported fields
}
func NewProjectAnalysisStore ¶
func NewProjectAnalysisStore() *ProjectAnalysisStore
func (*ProjectAnalysisStore) CurrentAnalysisHotspotSummary ¶
func (*ProjectAnalysisStore) Get ¶
func (s *ProjectAnalysisStore) Get(_ context.Context, tenantID, projectID, analysisID shared.ID) (projectanalysis.Analysis, error)
func (*ProjectAnalysisStore) GetHotspot ¶
func (*ProjectAnalysisStore) HotspotHistory ¶
func (s *ProjectAnalysisStore) HotspotHistory(ctx context.Context, tenantID, projectID, hotspotID shared.ID) ([]hotspot.ReviewEvent, error)
func (*ProjectAnalysisStore) IssueHistory ¶
func (s *ProjectAnalysisStore) IssueHistory(ctx context.Context, tenantID, projectID, issueID shared.ID) ([]issue.ReviewEvent, error)
func (*ProjectAnalysisStore) LatestForProjects ¶
func (*ProjectAnalysisStore) LatestWithResult ¶
func (s *ProjectAnalysisStore) LatestWithResult(_ context.Context, tenantID, projectID shared.ID) (projectanalysis.Analysis, []byte, error)
func (*ProjectAnalysisStore) ListAnalysisHotspots ¶
func (*ProjectAnalysisStore) ListHotspots ¶
func (s *ProjectAnalysisStore) ListHotspots(ctx context.Context, tenantID, projectID shared.ID, filter hotspot.ListFilter) (hotspot.Page, error)
func (*ProjectAnalysisStore) ListIssues ¶
func (s *ProjectAnalysisStore) ListIssues(ctx context.Context, tenantID, projectID shared.ID, filter issue.ListFilter) (issue.Page, error)
func (*ProjectAnalysisStore) ResolvedIssueKeys ¶
func (*ProjectAnalysisStore) Save ¶
func (s *ProjectAnalysisStore) Save(ctx context.Context, analysis projectanalysis.Analysis) error
func (*ProjectAnalysisStore) SaveWithResult ¶
func (s *ProjectAnalysisStore) SaveWithResult(_ context.Context, analysis projectanalysis.Analysis, result []byte) error
func (*ProjectAnalysisStore) SaveWithResultAndHotspots ¶
func (s *ProjectAnalysisStore) SaveWithResultAndHotspots(ctx context.Context, analysis projectanalysis.Analysis, result []byte, candidates []hotspot.Candidate) error
SaveWithResultAndHotspots satisfies ports.ProjectAnalysisProjectionStore; it is the hotspot-only projection (no issues), delegating to the combined path.
func (*ProjectAnalysisStore) SaveWithResultAndProjections ¶
func (*ProjectAnalysisStore) TransitionHotspot ¶
func (s *ProjectAnalysisStore) TransitionHotspot(ctx context.Context, cmd hotspot.TransitionCommand) (hotspot.Hotspot, hotspot.ReviewEvent, error)
func (*ProjectAnalysisStore) TransitionIssue ¶
func (s *ProjectAnalysisStore) TransitionIssue(ctx context.Context, cmd issue.TransitionCommand) (issue.Issue, issue.ReviewEvent, error)
type ProjectRepository ¶
type ProjectRepository struct {
// contains filtered or unexported fields
}
ProjectRepository is a goroutine-safe in-memory project store.
func NewProjectRepository ¶
func NewProjectRepository() *ProjectRepository
func (*ProjectRepository) AssignProfile ¶
func (*ProjectRepository) CountByGate ¶
func (*ProjectRepository) DeleteByKey ¶
func (*ProjectRepository) UpdateGate ¶
type QualityGateMutator ¶
type QualityGateMutator struct {
// contains filtered or unexported fields
}
QualityGateMutator makes managed-gate writes atomic with their audit record in memory.
func NewQualityGateMutator ¶
func NewQualityGateMutator(gates *QualityGateStore, projects *ProjectRepository, audit ports.AuditLogger) *QualityGateMutator
func (*QualityGateMutator) AssignProjectGate ¶
func (m *QualityGateMutator) AssignProjectGate(ctx context.Context, tenantID shared.ID, projectKey, gateID string, entry ports.AuditEntry) error
func (*QualityGateMutator) CreateGate ¶
func (m *QualityGateMutator) CreateGate(ctx context.Context, tenantID shared.ID, gate qualitygate.Gate, entry ports.AuditEntry) error
func (*QualityGateMutator) CreateProjectWithGate ¶
func (*QualityGateMutator) DeleteGate ¶
func (m *QualityGateMutator) DeleteGate(ctx context.Context, tenantID shared.ID, key string, entry ports.AuditEntry) error
func (*QualityGateMutator) UpdateGate ¶
func (m *QualityGateMutator) UpdateGate(ctx context.Context, tenantID shared.ID, gate qualitygate.Gate, entry ports.AuditEntry) error
type QualityGateStore ¶
type QualityGateStore struct {
// contains filtered or unexported fields
}
QualityGateStore is a goroutine-safe in-memory custom quality-gate store.
func NewQualityGateStore ¶
func NewQualityGateStore() *QualityGateStore
func (*QualityGateStore) Create ¶
func (s *QualityGateStore) Create(_ context.Context, tenantID shared.ID, gate qualitygate.Gate) error
func (*QualityGateStore) DeleteIfUnassigned ¶
func (*QualityGateStore) Get ¶
func (s *QualityGateStore) Get(_ context.Context, tenantID shared.ID, key string) (qualitygate.Gate, error)
func (*QualityGateStore) List ¶
func (s *QualityGateStore) List(_ context.Context, tenantID shared.ID) ([]qualitygate.Gate, error)
func (*QualityGateStore) Update ¶
func (s *QualityGateStore) Update(_ context.Context, tenantID shared.ID, gate qualitygate.Gate) error
type QualityProfileStore ¶
type QualityProfileStore struct {
// contains filtered or unexported fields
}
QualityProfileStore is a goroutine-safe in-memory custom quality-profile store.
func NewQualityProfileStore ¶
func NewQualityProfileStore() *QualityProfileStore
func (*QualityProfileStore) Create ¶
func (s *QualityProfileStore) Create(_ context.Context, tenantID shared.ID, profile qualityprofile.Profile) error
func (*QualityProfileStore) Get ¶
func (s *QualityProfileStore) Get(_ context.Context, tenantID shared.ID, key string) (qualityprofile.Profile, error)
func (*QualityProfileStore) List ¶
func (s *QualityProfileStore) List(_ context.Context, tenantID shared.ID) ([]qualityprofile.Profile, error)
func (*QualityProfileStore) Update ¶
func (s *QualityProfileStore) Update(_ context.Context, tenantID shared.ID, profile qualityprofile.Profile) error
type ReconRunRepository ¶
type ReconRunRepository struct {
// contains filtered or unexported fields
}
ReconRunRepository is an in-memory ports.ReconRunStore for dev/tests.
func NewReconRunRepository ¶
func NewReconRunRepository() *ReconRunRepository
NewReconRunRepository returns an empty in-memory recon-run store.
func (*ReconRunRepository) ListByEngagement ¶
func (r *ReconRunRepository) ListByEngagement(_ context.Context, engagementID shared.ID) ([]recon.Run, error)
ListByEngagement returns an engagement's runs, newest first.
type RetestRepository ¶
type RetestRepository struct {
// contains filtered or unexported fields
}
RetestRepository is an in-memory ports.RetestRepository for dev/tests.
func NewRetestRepository ¶
func NewRetestRepository() *RetestRepository
NewRetestRepository returns an empty in-memory retest store.
func (*RetestRepository) ListByEngagementFinding ¶
func (r *RetestRepository) ListByEngagementFinding(_ context.Context, engagementID, findingID shared.ID) ([]finding.Retest, error)
ListByEngagementFinding returns a finding's retests oldest-first, engagement-scoped.
type RunLock ¶
type RunLock struct {
// contains filtered or unexported fields
}
RunLock is the single-process ports.RunLocker (F9): an in-memory set of currently- executing run ids. It guards against a same-process redelivery (the in-memory queue's lease expiry) re-running a run that is still in flight. Cross-process guarding requires the Postgres advisory-lock implementation.
type ScanJobStore ¶
type ScanJobStore struct {
// contains filtered or unexported fields
}
ScanJobStore is an in-memory store of asynchronous scan-job status.
func NewScanJobStore ¶
func NewScanJobStore() *ScanJobStore
NewScanJobStore returns an empty in-memory scan-job store.
func (*ScanJobStore) CreateRunning ¶
func (*ScanJobStore) LatestForEngagement ¶
func (s *ScanJobStore) LatestForEngagement(_ context.Context, engagementID shared.ID) (ports.ScanJob, error)
LatestForEngagement returns the engagement's most recent job, or ErrNotFound.
func (*ScanJobStore) LatestForEngagements ¶
type ScanRepository ¶
type ScanRepository struct{}
ScanRepository is a no-op scan store for dev/tests: scan results are returned in the API response and not persisted without a database.
func NewScanRepository ¶
func NewScanRepository() *ScanRepository
NewScanRepository returns a no-op scan repository.
func (ScanRepository) SaveScan ¶
func (ScanRepository) SaveScan(context.Context, shared.ID, *sbom.SBOM, []vulnerability.Vulnerability, ports.ScanSnapshot) (int, error)
SaveScan discards the scan (dev mode has no durable storage); nothing is skipped.
type ScanResultStore ¶
type ScanResultStore struct {
// contains filtered or unexported fields
}
ScanResultStore is an in-memory cache of the latest scan result per engagement.
func NewScanResultStore ¶
func NewScanResultStore() *ScanResultStore
NewScanResultStore returns an empty in-memory scan-result store.
func (*ScanResultStore) LatestResult ¶
LatestResult returns the cached scan result, or shared.ErrNotFound.
func (*ScanResultStore) SaveResult ¶
func (s *ScanResultStore) SaveResult(_ context.Context, engagementID shared.ID, result []byte) error
SaveResult stores a copy of the engagement's latest scan result JSON.
type ScanRunStore ¶
type ScanRunStore struct {
// contains filtered or unexported fields
}
ScanRunStore is an in-memory store of scan-run manifests.
func NewScanRunStore ¶
func NewScanRunStore() *ScanRunStore
NewScanRunStore returns an empty in-memory scan-run store.
type ThreatModelStore ¶
type ThreatModelStore struct {
// contains filtered or unexported fields
}
ThreatModelStore is the in-memory architecture-input threat-model store (dev/tests, mirrors the Postgres adapter): one model per engagement, replaced on each Save (re-syncable, not append-only). Reads are engagement-scoped (the tenant gate runs upstream at the child route).
func NewThreatModelStore ¶
func NewThreatModelStore() *ThreatModelStore
NewThreatModelStore returns an empty in-memory threat-model store.
func (*ThreatModelStore) Get ¶
func (s *ThreatModelStore) Get(_ context.Context, engagementID shared.ID) (threatmodel.Model, bool, error)
Get returns the engagement's model, ok=false when none has been ingested.
func (*ThreatModelStore) Save ¶
func (s *ThreatModelStore) Save(_ context.Context, engagementID, _ shared.ID, m threatmodel.Model) error
Save upserts the engagement's model (tenant id unused in memory; the Postgres adapter persists it).
type TimestampStore ¶
type TimestampStore struct {
// contains filtered or unexported fields
}
TimestampStore is an in-memory ports.TimestampStore for dev/tests: external RFC-3161 tokens keyed by (chain, engagement, head).
func NewTimestampStore ¶
func NewTimestampStore() *TimestampStore
NewTimestampStore returns an empty in-memory timestamp store.
func (*TimestampStore) Get ¶
func (s *TimestampStore) Get(_ context.Context, chain string, eng shared.ID, head string) (*ports.TimestampToken, error)
Get returns the stored token for a head, or nil if not yet anchored.
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository is an in-memory ports.UserRepository for dev/tests.
func NewUserRepository ¶
func NewUserRepository() *UserRepository
NewUserRepository returns an empty in-memory user store.
func (*UserRepository) GetByAPIKeyHash ¶
type WriteupDraftStore ¶
type WriteupDraftStore struct {
// contains filtered or unexported fields
}
WriteupDraftStore is the in-memory write-up-draft repository (dev/tests). It mirrors the Postgres adapter to come: Save is an UPSERT by draft id (a draft is mutable working data – edited then accepted/rejected), and reads are engagement-scoped (tenant isolation is enforced upstream at the route). ListByEngagement returns a deterministic (created_at, id) order to match the SQL adapter.
func NewWriteupDraftStore ¶
func NewWriteupDraftStore() *WriteupDraftStore
NewWriteupDraftStore builds an empty in-memory draft store.
func (*WriteupDraftStore) Get ¶
func (s *WriteupDraftStore) Get(_ context.Context, engagementID, id shared.ID) (writeupdraft.Draft, error)
Get returns the engagement's draft by id, or shared.ErrNotFound.
func (*WriteupDraftStore) ListByEngagement ¶
func (s *WriteupDraftStore) ListByEngagement(_ context.Context, engagementID shared.ID) ([]writeupdraft.Draft, error)
ListByEngagement returns a copy of the engagement's drafts ordered by (created_at, id).
func (*WriteupDraftStore) Save ¶
func (s *WriteupDraftStore) Save(_ context.Context, d writeupdraft.Draft) error
Save upserts a draft by id within its engagement (replace in place if present, else append).
Source Files
¶
- advisory_store.go
- agent_session_store.go
- approval_store.go
- comment_repo.go
- decision_store.go
- engagement_repo.go
- evidence_repo.go
- finding_repo.go
- imported_sbom_store.go
- jobqueue.go
- judgment_store.go
- plan_store.go
- project_analysis_store.go
- project_hotspot_store.go
- project_issue_store.go
- project_repo.go
- quality_gate_mutator.go
- quality_gate_store.go
- quality_profile_store.go
- recon_run_repo.go
- retest_repo.go
- runlock.go
- scan_job_repo.go
- scan_repo.go
- scan_result_repo.go
- scan_run_repo.go
- threat_model_store.go
- timestamp_store.go
- user_repo.go
- writeupdraft_store.go