Documentation
¶
Index ¶
- func InitializeStorageBackend(ctx context.Context) (context.Context, error)
- func SetStorageBackend(ctx context.Context, backend Backend) context.Context
- type Backend
- type Check
- type CheckStatus
- type ChecksBackend
- type ChecksInsertParams
- type ChecksResult
- type FieldNotFoundError
- type FileBackend
- type MetadataBackend
- type MetadataResult
- type Outcomes
- type PolicyData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface {
Metadata() MetadataBackend
Checks() ChecksBackend
}
func MustGetBackend ¶
type CheckStatus ¶
type CheckStatus string
const ( StatusCompliant CheckStatus = "compliant" StatusViolation CheckStatus = "violation" StatusSkipped CheckStatus = "skipped" )
func (CheckStatus) String ¶
func (s CheckStatus) String() string
type ChecksBackend ¶
type ChecksBackend interface {
Get(ctx context.Context, analysisID string) (*ChecksInsertParams, error)
Exists(ctx context.Context, analysisID string) (bool, error)
Insert(ctx context.Context, params ChecksInsertParams) error
GetBatch(ctx context.Context, analysisIDs []string) ([]*ChecksInsertParams, error)
GetPolicy(ctx context.Context, analysisID string) (string, error)
}
type ChecksInsertParams ¶
type ChecksInsertParams struct {
Checks ChecksResult
Policy *PolicyData
}
type ChecksResult ¶
type FieldNotFoundError ¶
type FieldNotFoundError struct {
Field string
}
type FileBackend ¶
type FileBackend struct {
// contains filtered or unexported fields
}
func NewFileBackend ¶
func NewFileBackend() *FileBackend
func (*FileBackend) Checks ¶
func (f *FileBackend) Checks() ChecksBackend
func (*FileBackend) Metadata ¶
func (f *FileBackend) Metadata() MetadataBackend
type MetadataBackend ¶
type MetadataResult ¶
type MetadataResult struct {
AnalysisIdentifier string `json:"analysis_identifier"`
AnalyzedAt time.Time `json:"analyzed_at"`
TraceID string `json:"trace_id,omitempty"`
SourceURL string `json:"source_url,omitempty"`
Ecosystem string `json:"ecosystem,omitempty"`
PackageName string `json:"package_name,omitempty"`
PackageVersion string `json:"package_version,omitempty"`
Input dag_impl.Input `json:"input"`
Data map[string]any `json:"data"`
}
type Outcomes ¶
type Outcomes map[CheckStatus]string
Outcomes maps each check status to a description of what that result means.
type PolicyData ¶
Click to show internal directories.
Click to hide internal directories.