Documentation
¶
Index ¶
- Variables
- func NewInspectError(language Language, message string) error
- func WithInspectorTask(ctx context.Context, scanDir string) context.Context
- func WithScanTask(ctx context.Context, task *ScanTask) context.Context
- type Contributor
- type Dependency
- type FileHash
- type GitInfo
- type InspectError
- type InspectorTask
- type Language
- type LicenseLevel
- type Module
- type PackageManagerType
- type ProjectType
- type ScanTask
- type SuggestLevel
- type TaskKind
- type TaskScanResponse
- type TaskType
- type VoVulnInfo
- type VulnLevelType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoGitRepo = errors.New("No git repo found")
Functions ¶
func NewInspectError ¶
func WithInspectorTask ¶
Types ¶
type Contributor ¶
type Dependency ¶
type Dependency struct {
Name string `json:"name"`
Version string `json:"version"`
Dependencies []Dependency `json:"dependencies,omitempty"`
}
type GitInfo ¶
type GitInfo struct {
RemoteName string `json:"remote_name"`
RemoteURL string `json:"remote_url"`
HeadCommitHash string `json:"head_commit_hash"`
HeadRefName string `json:"head_ref_name"`
ProjectName string `json:"project_name"`
CommitMsg string `json:"commit_msg"`
Committer string `json:"committer"`
CommitterEmail string `json:"committer_email"`
CommitTime time.Time `json:"commit_time"`
}
type InspectError ¶
func (InspectError) Error ¶
func (i InspectError) Error() string
type InspectorTask ¶
func UseInspectorTask ¶
func UseInspectorTask(ctx context.Context) *InspectorTask
func (*InspectorTask) AddModule ¶
func (i *InspectorTask) AddModule(module Module)
type LicenseLevel ¶
type LicenseLevel string
const ( LicenseLevelLow LicenseLevel = "Low" LicenseLevelMedium LicenseLevel = "Medium" LicenseLevelHigh LicenseLevel = "High" )
type Module ¶
type Module struct {
PackageManager PackageManagerType `json:"package_manager"`
Language Language `json:"language"`
PackageFile string `json:"package_file"`
Name string `json:"name"`
Version string `json:"version"`
FilePath string `json:"relative_path"`
Dependencies []Dependency `json:"dependencies,omitempty"`
RuntimeInfo interface{} `json:"runtime_info,omitempty"`
UUID uuid.UUID `json:"uuid"`
}
type PackageManagerType ¶
type PackageManagerType string
const ( PMMaven PackageManagerType = "maven" PMGoMod PackageManagerType = "gomod" PMNpm PackageManagerType = "npm" PMGradle PackageManagerType = "gradle" PMYarn PackageManagerType = "yarn" PMPython PackageManagerType = "python" PMPip PackageManagerType = "pip" PMComposer PackageManagerType = "composer" PMBundler PackageManagerType = "bundler" PMCocoaPods PackageManagerType = "cocoapods" PMPoetry PackageManagerType = "poetry" )
type ProjectType ¶
type ProjectType string
const ( ProjectTypeLocal ProjectType = "Local" ProjectTypeGit ProjectType = "Git" )
type ScanTask ¶
type ScanTask struct {
TaskId string
ProjectDir string
ProjectName string
Kind TaskKind
ProjectType ProjectType
ProjectId string
StartTime time.Time
GitInfo *GitInfo
TaskType TaskType
ContributorList []Contributor
TotalContributors int
Modules []Module
ScanResult *TaskScanResponse
EnableDeepScan bool
FileHashes []FileHash
}
func CreateScanTask ¶
func UseScanTask ¶
type SuggestLevel ¶
type SuggestLevel string
const ( SuggestLevelOptional SuggestLevel = "Optional" SuggestLevelRecommend SuggestLevel = "Recommend" SuggestLevelStrongRecommend SuggestLevel = "StrongRecommend" )
type TaskScanResponse ¶
type TaskScanResponse struct {
Complete bool `json:"complete"`
DependenciesCount int `json:"dependencies_count"`
IssuesCompsCount int `json:"issues_comps_count"`
Modules []struct {
ModuleId int `json:"module_id"`
Language string `json:"language"`
PackageManager string `json:"package_manager"`
Comps []struct {
MinFixedInfo []struct {
Name string `json:"name"`
OldVersion string `json:"old_version"`
NewVersion string `json:"new_version"`
} `json:"min_fixed_info,omitempty"`
IsDirectDependency bool `json:"is_direct_dependency"`
CompId int `json:"comp_id"`
CompName string `json:"comp_name"`
CompVersion string `json:"comp_version"`
MinFixedVersion string `json:"min_fixed_version"`
License *struct {
Level LicenseLevel `json:"level"`
Spdx string `json:"spdx"`
} `json:"license,omitempty"`
Solutions []struct {
Compatibility *int `json:"compatibility,omitempty"`
Description string `json:"description"`
Type string `json:"type,omitempty"`
} `json:"solutions,omitempty"`
Vuls []VoVulnInfo `json:"vuls"`
FixType string `json:"fix_type"`
} `json:"comps"`
} `json:"modules"`
TaskId string `json:"task_id"`
Status string `json:"status"`
}
type VoVulnInfo ¶
type VoVulnInfo struct {
CveId string `json:"cve_id"`
Description string `json:"description"`
Level VulnLevelType `json:"level"`
Influence int `json:"influence"`
Poc bool `json:"poc"`
PublishTime int `json:"publish_time"`
AffectedVersion string `json:"affected_version"`
MinFixedVersion string `json:"min_fixed_version"`
References []struct {
Name string `json:"name"`
Url string `json:"url"`
} `json:"references"`
Solutions []struct {
Type string `json:"type"`
Description string `json:"description"`
Compatibility int `json:"compatibility"`
} `json:"solutions"`
SuggestLevel SuggestLevel `json:"suggest_level"`
VulnNo string `json:"vuln_no"`
VulnPath []string `json:"vuln_path"`
Title string `json:"title"`
}
type VulnLevelType ¶
type VulnLevelType string
const ( VulnLevelCritical VulnLevelType = "Critical" VulnLevelHigh VulnLevelType = "High" VulnLevelMedium VulnLevelType = "Medium" VulnLevelLow VulnLevelType = "Low" )
Click to show internal directories.
Click to hide internal directories.