Help us shape the future of Go! Take the 2026 Go Developer Survey

scanners

package
v1.233.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OnFailureWarn   = "warn"
	OnFailureFail   = "fail"
	OnFailureIgnore = "ignore"
)
View Source
const (
	FormatMarkdown = "markdown"
)

Variables

This section is empty.

Functions

func BuildAtmosEnv

func BuildAtmosEnv(scan *Context, outputFile, outputDir string) map[string]string

func ComponentPath

func ComponentPath(ctx *Context) string

Types

type Artifact

type Artifact struct {
	Name     string
	Body     []byte
	Format   string
	Metadata map[string]string
}

type Context

type Context struct {
	Name          string
	Command       string
	Args          []string
	Env           map[string]string
	BaseEnv       []string
	Format        string
	OnFailure     string
	CaptureStdout bool
	ResultHandler ResultHandler

	AtmosConfig   *schema.AtmosConfiguration
	Info          *schema.ConfigAndStacksInfo
	ToolchainPATH string

	OutputFile   string
	OutputDir    string
	ExitCode     int
	CommandError error
}

type Finding

type Finding struct {
	Path     string
	Line     int
	Severity string
	RuleID   string
	Message  string
}

type Output

type Output struct {
	Artifact *Artifact
	Summary  *Summary
}

func Run

func Run(ctx context.Context, scan *Context) (*Output, error)

type ResultHandler

type ResultHandler func(ctx *Context) (*Summary, error)

type Summary

type Summary struct {
	Kind   string
	Status SummaryStatus
	Title  string
	Counts map[string]int
	// Body is the Markdown summary shared by terminal Markdown output, CI, Pro,
	// PR comments, and code-scanning consumers.
	Body string
	// TerminalBody, when set, replaces Body only in local terminal output. It is
	// plain terminal text (not Markdown), so callers can use presentation such
	// as source excerpts without changing shared scanner reports.
	TerminalBody string
	Findings     []Finding
	SARIF        []byte
}

type SummaryStatus

type SummaryStatus string
const (
	StatusSuccess SummaryStatus = "success"
	StatusWarning SummaryStatus = "warning"
	StatusFailure SummaryStatus = "failure"
)

Directories

Path Synopsis
Package sarif parses SARIF 2.1.0 documents into a normalized Findings representation usable by hook ResultHandlers.
Package sarif parses SARIF 2.1.0 documents into a normalized Findings representation usable by hook ResultHandlers.

Jump to

Keyboard shortcuts

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