Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct {
Ecosystem string
Name string
Version string
Source string
SourceType SourceType
}
type ExcludeSet ¶
type ExcludeSet struct {
// contains filtered or unexported fields
}
ExcludeSet holds package suppressions loaded from an exclude file. Any audited dependency that matches an entry is dropped from findings — used to silence known false positives. Entries are "ecosystem:name"; an ecosystem of "*" matches any ecosystem.
func LoadExcludeFile ¶
func LoadExcludeFile(path string) (ExcludeSet, error)
LoadExcludeFile reads newline-separated "ecosystem:name" entries from path. Blank lines and lines beginning with '#' are ignored. An ecosystem of "*" matches any ecosystem. The ecosystem/name split is on the first colon, so Maven coordinates ("Maven:group:artifact") are preserved. Malformed lines return an error citing the line number.
func (ExcludeSet) Empty ¶
func (s ExcludeSet) Empty() bool
Empty reports whether the set has no entries.
func (ExcludeSet) Has ¶
func (s ExcludeSet) Has(ecosystem, name string) bool
Has reports whether the given ecosystem/name pair is excluded.
type Finding ¶
type Finding struct {
Verdict string `json:"verdict"`
Ecosystem string `json:"ecosystem"`
Name string `json:"name"`
Version string `json:"version"`
IDs []string `json:"ids"`
Summary string `json:"summary,omitempty"`
Published time.Time `json:"published_at,omitempty"`
ModifiedAt time.Time `json:"modified_at,omitempty"`
Source string `json:"source,omitempty"`
SourceType string `json:"source_type,omitempty"`
Lockfile string `json:"lockfile,omitempty"`
ProjectDir string `json:"project_dir,omitempty"`
ProjectURL string `json:"project_url,omitempty"`
PackageURL string `json:"registry_url,omitempty"`
}
type GitHubOptions ¶
GitHubOptions configures optional GitHub SBOM audit inputs.
type Options ¶
type Options struct {
Progress *Progress
GitHub *GitHubOptions
DisplayPaths []string // optional user-facing targets (e.g. org URL vs expanded repos)
// Exclude suppresses matched packages from findings (known false
// positives). Excluded matches are silently counted as clean.
Exclude ExcludeSet
// SBOMExport, when set, writes an SBOM of the audited dependencies to this
// path. SBOMFormat is optional ("cyclonedx" default, or "spdx").
SBOMExport string
SBOMFormat string
SBOMToolVersion string
}
type Progress ¶
type Progress struct {
OnDiscover func(found int, currentPath string)
OnDiscovered func(lockfileCount int, root string)
OnLockfile func(index, total int, path string, depCount int)
OnSource func(index, total int, path string, sourceType SourceType, depCount int)
OnIndex func(loaded, total int)
OnQuery func(checked, total int, lockfile string)
OnFinding func(Finding)
OnStatus func(msg string)
OnComplete func()
}
type Result ¶
type Result struct {
Paths []string `json:"paths"`
Lockfiles []Lockfile `json:"lockfiles"`
Dependencies int `json:"dependencies"`
Summary Summary `json:"summary"`
Findings []Finding `json:"findings"`
FindingsStreamed bool `json:"-"`
Mode string `json:"mode,omitempty"`
DurationMS int64 `json:"duration_ms,omitempty"`
SBOMPath string `json:"sbom_path,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
type SourceType ¶
type SourceType string
const ( SourceTypeLockfile SourceType = "lockfile" SourceTypeSBOM SourceType = "sbom" )