Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidData is returned when a method in Storage finds inconsistent // data in the db, for instance, a Finding without a target. ErrInvalidData = errors.New("inconsistent data found") )
Functions ¶
Types ¶
type Filter ¶
type Filter struct { Status string Team string Teams string Identifier string Identifiers string IdentifierMatch bool MinScore float32 MaxScore float32 MinDate string MaxDate string AtDate string Page int Size int SortBy SortBy IssueID string TargetID string SourceID string Labels string }
Filter holds query filtering information.
type Pagination ¶
type Pagination struct { Limit int `json:"limit"` Offset int `json:"offset"` Total int `json:"total"` }
Pagination holds database pagination information.
type Storage ¶
type Storage interface { ListSources(filter Filter) ([]model.Source, Pagination, error) GetSource(id string) (model.Source, error) GetSourceMTTR(id string) (float32, error) ListTargets(filter Filter) ([]model.Target, Pagination, error) TargetsSummary(filter Filter) ([]model.TargetSummary, Pagination, error) GetTarget(id string) (model.Target, error) GetTargetMTTR(id string) (float32, error) CreateTarget(target model.Target) (model.Target, error) DeleteTeam(teamID string) error DeleteTargetTeam(targetID, teamID string) error ListIssues(filter Filter) ([]model.Issue, Pagination, error) IssuesSummary(filter Filter) ([]model.IssueSummary, Pagination, error) GetIssue(id string) (model.Issue, error) GetIssueMTTR(id string) (float32, error) ListLabels(filter Filter) ([]string, error) ListFindings(filter Filter) ([]model.FindingExpanded, Pagination, error) GetFinding(id string) (model.FindingExpanded, error) GetFindingFromTargetIssueAndResource(targetID, affectedResource, issueID string) (model.FindingExpanded, error) ListFindingsByTarget(id string, filter Filter) ([]model.FindingExpanded, Pagination, error) ListFindingsByIssue(id string, filter Filter) ([]model.FindingExpanded, Pagination, error) ListFindingsBySource(id string, filter Filter) ([]model.FindingExpanded, Pagination, error) ListFindingEventsByFinding(id string, filter Filter) ([]model.FindingEvent, Pagination, error) GetFindingMTTR(id string) (float32, error) PatchFinding(id string, payload model.PatchFindingPayload) error ListFindingEvents(filter Filter) ([]model.FindingEvent, Pagination, error) StatsSize() (model.StatsSize, error) StatsOpenIssues(filter Filter) (model.StatsIssueSeverity, error) StatsFixedIssues(filter Filter) (model.StatsIssueSeverity, error) StatsIssues(filter Filter) ([]model.Issue, Pagination, error) StatsMTTR(filter Filter) (model.StatsMTTRSeverity, error) StatsExposure(filter Filter) (model.StatsExposure, error) StatsCurrentExposure(filter Filter) (model.StatsExposure, error) StatsAssetsPerSeverity(filter Filter) (model.StatsAssetsSeverity, error) }
Storage defines the API for querying data from storage.
Click to show internal directories.
Click to hide internal directories.