Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanStrategy ¶
type CleanStrategy string
CleanStrategy says what a cleaner may do.
const ( CleanStrip CleanStrategy = "strip" CleanNormalize CleanStrategy = "normalize" CleanRewrite CleanStrategy = "rewrite" CleanReportOnly CleanStrategy = "report_only" )
func (CleanStrategy) Writable ¶
func (s CleanStrategy) Writable() bool
Writable reports whether the strategy may mutate bytes.
type Confidence ¶
type Confidence string
Confidence is how sure a detector is.
const ( ConfidenceCertain Confidence = "certain" ConfidenceLikely Confidence = "likely" ConfidenceHeuristic Confidence = "heuristic" )
const ConfidenceNone Confidence = "none"
ConfidenceNone disables fail-on.
func (Confidence) AtLeast ¶
func (c Confidence) AtLeast(min Confidence) bool
AtLeast reports whether c meets the fail-on threshold.
func (Confidence) Rank ¶
func (c Confidence) Rank() int
Rank returns a higher number for stronger confidence.
type Finding ¶
type Finding struct {
RuleID string `json:"rule_id" yaml:"rule_id"`
Family Family `json:"family" yaml:"family"`
Severity Severity `json:"severity" yaml:"severity"`
Confidence Confidence `json:"confidence" yaml:"confidence"`
Span Span `json:"span" yaml:"span"`
Message string `json:"message" yaml:"message"`
Evidence string `json:"evidence,omitempty" yaml:"evidence,omitempty"`
Snippet string `json:"snippet,omitempty" yaml:"snippet,omitempty"`
Symbol string `json:"symbol,omitempty" yaml:"symbol,omitempty"`
Function string `json:"function,omitempty" yaml:"function,omitempty"`
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
Clean CleanStrategy `json:"clean" yaml:"clean"`
Replacement string `json:"replacement,omitempty" yaml:"replacement,omitempty"`
Protect bool `json:"protect,omitempty" yaml:"protect,omitempty"`
ProtectKind string `json:"protect_kind,omitempty" yaml:"protect_kind,omitempty"`
}
Finding is one detector hit.
type Kind ¶
type Kind string
Kind is the blot pipeline class for a file (watermarks-remover layers).
type Patch ¶
type Patch struct {
Path string `json:"path" yaml:"path"`
Original []byte `json:"-" yaml:"-"`
Updated []byte `json:"-" yaml:"-"`
Applied []Finding `json:"applied,omitempty" yaml:"applied,omitempty"`
Skipped []Finding `json:"skipped,omitempty" yaml:"skipped,omitempty"`
}
Patch is a planned mutation of a single file.
type Score ¶
type Score struct {
Percent int `json:"percent" yaml:"percent"`
Agent string `json:"agent" yaml:"agent"`
Label string `json:"label" yaml:"label"`
Agents map[string]int `json:"agents,omitempty" yaml:"agents,omitempty"`
Confidence Confidence `json:"confidence,omitempty" yaml:"confidence,omitempty"`
Evidence []string `json:"evidence,omitempty" yaml:"evidence,omitempty"`
}
Score is an aggregate forensic AI-trace estimate for a scan.
type Span ¶
type Span struct {
File string `json:"file" yaml:"file"`
Start int `json:"start" yaml:"start"`
End int `json:"end" yaml:"end"`
Line int `json:"line" yaml:"line"`
Col int `json:"col" yaml:"col"`
}
Span is a UTF-8 byte range inside a file.
type Unit ¶
type Unit struct {
Path string `json:"path"`
RelPath string `json:"rel_path,omitempty"`
Bytes []byte `json:"-"`
Charset string `json:"charset,omitempty"`
Language Language `json:"language,omitempty"`
Kind Kind `json:"kind,omitempty"`
HasBOM bool `json:"has_bom,omitempty"`
}
Unit is a decoded file ready for detectors. Detectors must not read the FS.
Click to show internal directories.
Click to hide internal directories.