types

package
v1.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IssuesSeverity = map[string]Severity{
	"critical": Critical,
	"high":     High,
	"low":      Low,
	"medium":   Medium,
}

Functions

This section is empty.

Types

type DataflowElement

type DataflowElement struct {
	Position  int      `json:"position"`
	FilePath  FilePath `json:"filePath"`
	FlowRange Range    `json:"flowRange"`
	Content   string   `json:"content"`
}

type FilePath

type FilePath string

type IssueData

type IssueData struct {
	ID          string            `json:"id"`
	Title       string            `json:"title"`
	Severity    string            `json:"severity"`
	Dataflow    []DataflowElement `json:"dataflow,omitempty"`
	CWEs        []string          `json:"cwes,omitempty"`
	CVEs        []string          `json:"cves,omitempty"`
	PackageName string            `json:"packageName,omitempty"`
	Version     string            `json:"version,omitempty"`
	Ecosystem   string            `json:"ecosystem,omitempty"`
	FixedIn     []string          `json:"fixedIn,omitempty"`
	Remediation string            `json:"remediation,omitempty"`
	FilePath    string            `json:"filePath,omitempty"`
	Line        int               `json:"line,omitempty"`
	Column      int               `json:"column,omitempty"`
	Message     string            `json:"message,omitempty"`
	FingerPrint string            `json:"fingerPrint,omitempty"`
	IsIgnored   bool              `json:"isIgnored,omitempty"`
	// IsTransitiveDependency is set by SCA scans only. Pointer + omitempty
	// preserves false in SCA payloads while keeping the key absent from non-SCA
	// payloads.
	IsTransitiveDependency *bool `json:"isTransitiveDependency,omitempty"`
	// IntroducedThrough is the CLI dependency chain from the direct dependency
	// to the vulnerable package: ordered from[1:] entries (project root
	// excluded). Nil or empty omits the JSON key (omitempty).
	IntroducedThrough []string `json:"introducedThrough,omitempty"`
}

IssueData contains extracted issue information for serialization

type OpenBrowserFunc

type OpenBrowserFunc func(url string)
var (
	DefaultOpenBrowserFunc OpenBrowserFunc = func(url string) {
		browser.Stdout = log.Logger
		_ = browser.OpenURL(url)
	}
)

type Position

type Position struct {
	Line      int `json:"line"`
	Character int `json:"character"`
}

type Range

type Range struct {
	Start Position `json:"start"`
	End   Position `json:"end"`
}

type Severity

type Severity int8
const (
	Critical Severity = iota
	High
	Medium
	Low
)

func (Severity) String

func (s Severity) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL