output

package
v0.0.0-...-22c5fc7 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CiConfig

type CiConfig struct {
	// Autofix corresponds to the JSON schema field "autofix".
	Autofix bool `json:"autofix" yaml:"autofix" mapstructure:"autofix"`

	// EnabledProducts corresponds to the JSON schema field "enabled_products".
	EnabledProducts []CiConfigEnabledProductsElem `json:"enabled_products" yaml:"enabled_products" mapstructure:"enabled_products"`

	// Env corresponds to the JSON schema field "env".
	Env CiEnv `json:"env" yaml:"env" mapstructure:"env"`

	// IgnoredFiles corresponds to the JSON schema field "ignored_files".
	IgnoredFiles []string `json:"ignored_files" yaml:"ignored_files" mapstructure:"ignored_files"`
}

func (*CiConfig) UnmarshalJSON

func (j *CiConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CiConfigEnabledProductsElem

type CiConfigEnabledProductsElem interface{}

type CiConfigFromCloud

type CiConfigFromCloud struct {
	// DirsConfig corresponds to the JSON schema field "dirs_config".
	DirsConfig [][]interface{} `json:"dirs_config,omitempty" yaml:"dirs_config,omitempty" mapstructure:"dirs_config,omitempty"`

	// OrgConfig corresponds to the JSON schema field "org_config".
	OrgConfig *CiConfig `json:"org_config,omitempty" yaml:"org_config,omitempty" mapstructure:"org_config,omitempty"`

	// RepoConfig corresponds to the JSON schema field "repo_config".
	RepoConfig CiConfig `json:"repo_config" yaml:"repo_config" mapstructure:"repo_config"`
}

func (*CiConfigFromCloud) UnmarshalJSON

func (j *CiConfigFromCloud) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CiConfigFromRepo

type CiConfigFromRepo struct {
	// Tags corresponds to the JSON schema field "tags".
	Tags []Tag `json:"tags,omitempty" yaml:"tags,omitempty" mapstructure:"tags,omitempty"`

	// Version corresponds to the JSON schema field "version".
	Version *Version `json:"version,omitempty" yaml:"version,omitempty" mapstructure:"version,omitempty"`
}

type CiEnv

type CiEnv map[string]string

type CiScanComplete

type CiScanComplete struct {
	// Dependencies corresponds to the JSON schema field "dependencies".
	Dependencies CiScanDependencies `json:"dependencies,omitempty" yaml:"dependencies,omitempty" mapstructure:"dependencies,omitempty"`

	// DependencyParserErrors corresponds to the JSON schema field
	// "dependency_parser_errors".
	DependencyParserErrors []DependencyParserError `` /* 133-byte string literal not displayed */

	// ExitCode corresponds to the JSON schema field "exit_code".
	ExitCode int `json:"exit_code" yaml:"exit_code" mapstructure:"exit_code"`

	// FinalAttempt corresponds to the JSON schema field "final_attempt".
	FinalAttempt *bool `json:"final_attempt,omitempty" yaml:"final_attempt,omitempty" mapstructure:"final_attempt,omitempty"`

	// Stats corresponds to the JSON schema field "stats".
	Stats CiScanCompleteStats `json:"stats" yaml:"stats" mapstructure:"stats"`

	// TaskId corresponds to the JSON schema field "task_id".
	TaskId *string `json:"task_id,omitempty" yaml:"task_id,omitempty" mapstructure:"task_id,omitempty"`
}

func (*CiScanComplete) UnmarshalJSON

func (j *CiScanComplete) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CiScanCompleteResponse

type CiScanCompleteResponse struct {
	// AppBlockOverride corresponds to the JSON schema field "app_block_override".
	AppBlockOverride *bool `json:"app_block_override,omitempty" yaml:"app_block_override,omitempty" mapstructure:"app_block_override,omitempty"`

	// AppBlockReason corresponds to the JSON schema field "app_block_reason".
	AppBlockReason *string `json:"app_block_reason,omitempty" yaml:"app_block_reason,omitempty" mapstructure:"app_block_reason,omitempty"`

	// Success corresponds to the JSON schema field "success".
	Success bool `json:"success" yaml:"success" mapstructure:"success"`
}

func (*CiScanCompleteResponse) UnmarshalJSON

func (j *CiScanCompleteResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CiScanCompleteStats

type CiScanCompleteStats struct {
	// EngineRequested corresponds to the JSON schema field "engine_requested".
	EngineRequested *string `json:"engine_requested,omitempty" yaml:"engine_requested,omitempty" mapstructure:"engine_requested,omitempty"`

	// Errors corresponds to the JSON schema field "errors".
	Errors []CliError `json:"errors" yaml:"errors" mapstructure:"errors"`

	// Findings corresponds to the JSON schema field "findings".
	Findings int `json:"findings" yaml:"findings" mapstructure:"findings"`

	// LockfileScanInfo corresponds to the JSON schema field "lockfile_scan_info".
	LockfileScanInfo CiScanCompleteStatsLockfileScanInfo `json:"lockfile_scan_info" yaml:"lockfile_scan_info" mapstructure:"lockfile_scan_info"`

	// ParseRate corresponds to the JSON schema field "parse_rate".
	ParseRate CiScanCompleteStatsParseRate `json:"parse_rate" yaml:"parse_rate" mapstructure:"parse_rate"`

	// TotalTime corresponds to the JSON schema field "total_time".
	TotalTime float64 `json:"total_time" yaml:"total_time" mapstructure:"total_time"`

	// UnsupportedExts corresponds to the JSON schema field "unsupported_exts".
	UnsupportedExts CiScanCompleteStatsUnsupportedExts `json:"unsupported_exts" yaml:"unsupported_exts" mapstructure:"unsupported_exts"`
}

func (*CiScanCompleteStats) UnmarshalJSON

func (j *CiScanCompleteStats) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CiScanCompleteStatsLockfileScanInfo

type CiScanCompleteStatsLockfileScanInfo map[string]int

type CiScanCompleteStatsParseRate

type CiScanCompleteStatsParseRate map[string]ParsingStats

type CiScanCompleteStatsUnsupportedExts

type CiScanCompleteStatsUnsupportedExts map[string]int

type CiScanDependencies

type CiScanDependencies map[string][]FoundDependency

type CiScanFailure

type CiScanFailure struct {
	// ExitCode corresponds to the JSON schema field "exit_code".
	ExitCode int `json:"exit_code" yaml:"exit_code" mapstructure:"exit_code"`

	// Stderr corresponds to the JSON schema field "stderr".
	Stderr string `json:"stderr" yaml:"stderr" mapstructure:"stderr"`
}

func (*CiScanFailure) UnmarshalJSON

func (j *CiScanFailure) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CiScanResults

type CiScanResults struct {
	// Contributions corresponds to the JSON schema field "contributions".
	Contributions Contributions `json:"contributions,omitempty" yaml:"contributions,omitempty" mapstructure:"contributions,omitempty"`

	// Dependencies corresponds to the JSON schema field "dependencies".
	Dependencies CiScanDependencies `json:"dependencies,omitempty" yaml:"dependencies,omitempty" mapstructure:"dependencies,omitempty"`

	// Findings corresponds to the JSON schema field "findings".
	Findings []Finding `json:"findings" yaml:"findings" mapstructure:"findings"`

	// Ignores corresponds to the JSON schema field "ignores".
	Ignores []Finding `json:"ignores" yaml:"ignores" mapstructure:"ignores"`

	// RenamedPaths corresponds to the JSON schema field "renamed_paths".
	RenamedPaths []Fpath `json:"renamed_paths" yaml:"renamed_paths" mapstructure:"renamed_paths"`

	// RuleIds corresponds to the JSON schema field "rule_ids".
	RuleIds []RuleId `json:"rule_ids" yaml:"rule_ids" mapstructure:"rule_ids"`

	// SearchedPaths corresponds to the JSON schema field "searched_paths".
	SearchedPaths []Fpath `json:"searched_paths" yaml:"searched_paths" mapstructure:"searched_paths"`

	// Token corresponds to the JSON schema field "token".
	Token *string `json:"token" yaml:"token" mapstructure:"token"`
}

func (*CiScanResults) UnmarshalJSON

func (j *CiScanResults) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CiScanResultsResponse

type CiScanResultsResponse struct {
	// Errors corresponds to the JSON schema field "errors".
	Errors []CiScanResultsResponseError `json:"errors" yaml:"errors" mapstructure:"errors"`

	// TaskId corresponds to the JSON schema field "task_id".
	TaskId *string `json:"task_id,omitempty" yaml:"task_id,omitempty" mapstructure:"task_id,omitempty"`
}

func (*CiScanResultsResponse) UnmarshalJSON

func (j *CiScanResultsResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CiScanResultsResponseError

type CiScanResultsResponseError struct {
	// Message corresponds to the JSON schema field "message".
	Message string `json:"message" yaml:"message" mapstructure:"message"`
}

func (*CiScanResultsResponseError) UnmarshalJSON

func (j *CiScanResultsResponseError) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CliError

type CliError struct {
	// Code corresponds to the JSON schema field "code".
	Code int `json:"code" yaml:"code" mapstructure:"code"`

	// Help corresponds to the JSON schema field "help".
	Help *string `json:"help,omitempty" yaml:"help,omitempty" mapstructure:"help,omitempty"`

	// Level corresponds to the JSON schema field "level".
	Level CliErrorLevel `json:"level" yaml:"level" mapstructure:"level"`

	// LongMsg corresponds to the JSON schema field "long_msg".
	LongMsg *string `json:"long_msg,omitempty" yaml:"long_msg,omitempty" mapstructure:"long_msg,omitempty"`

	// Message corresponds to the JSON schema field "message".
	Message *string `json:"message,omitempty" yaml:"message,omitempty" mapstructure:"message,omitempty"`

	// Path corresponds to the JSON schema field "path".
	Path *Fpath `json:"path,omitempty" yaml:"path,omitempty" mapstructure:"path,omitempty"`

	// RuleId corresponds to the JSON schema field "rule_id".
	RuleId *RuleId `json:"rule_id,omitempty" yaml:"rule_id,omitempty" mapstructure:"rule_id,omitempty"`

	// ShortMsg corresponds to the JSON schema field "short_msg".
	ShortMsg *string `json:"short_msg,omitempty" yaml:"short_msg,omitempty" mapstructure:"short_msg,omitempty"`

	// Spans corresponds to the JSON schema field "spans".
	Spans []ErrorSpan `json:"spans,omitempty" yaml:"spans,omitempty" mapstructure:"spans,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type CliErrorType `json:"type" yaml:"type" mapstructure:"type"`
}

func (*CliError) UnmarshalJSON

func (j *CliError) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CliErrorLevel

type CliErrorLevel interface{}

type CliErrorType

type CliErrorType interface{}

type CliMatch

type CliMatch struct {
	// CheckId corresponds to the JSON schema field "check_id".
	CheckId RuleId `json:"check_id" yaml:"check_id" mapstructure:"check_id"`

	// End corresponds to the JSON schema field "end".
	End Position `json:"end" yaml:"end" mapstructure:"end"`

	// Extra corresponds to the JSON schema field "extra".
	Extra CliMatchExtra `json:"extra" yaml:"extra" mapstructure:"extra"`

	// Path corresponds to the JSON schema field "path".
	Path Fpath `json:"path" yaml:"path" mapstructure:"path"`

	// Start corresponds to the JSON schema field "start".
	Start Position `json:"start" yaml:"start" mapstructure:"start"`
}

func (CliMatch) FilePath

func (c CliMatch) FilePath() string

FilePath returns the file path of a match/hit/result as a string.

func (CliMatch) Message

func (c CliMatch) Message() string

Return the message of a match/hit/result as a string.

func (CliMatch) Metadata

func (c CliMatch) Metadata(name string) (interface{}, error)

Return the value of a metadata field. These come directly from the metadata field in the rule. They're freeform, but usually map[string]interface{}. Return an error if they key doesn't exist.

func (CliMatch) Metavar

func (c CliMatch) Metavar(name string) (string, error)

Return the value of a metavariable in the result. We will convert the metavariable name to upper case and prepend it with `$` if it's missing. E.g., `path` -> `$PATH`. If both `abstract_content` and `propagated_value` fields are populated, we return `propagated_value`. Return an error if the metavariable doesn't exist.

func (CliMatch) RuleID

func (c CliMatch) RuleID() string

RuleID returns the rule ID of a match/hit/result as a string.

func (*CliMatch) UnmarshalJSON

func (j *CliMatch) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CliMatchExtra

type CliMatchExtra struct {
	// DataflowTrace corresponds to the JSON schema field "dataflow_trace".
	DataflowTrace *MatchDataflowTrace `json:"dataflow_trace,omitempty" yaml:"dataflow_trace,omitempty" mapstructure:"dataflow_trace,omitempty"`

	// EngineKind corresponds to the JSON schema field "engine_kind".
	EngineKind CliMatchExtraEngineKind `json:"engine_kind,omitempty" yaml:"engine_kind,omitempty" mapstructure:"engine_kind,omitempty"`

	// ExtraExtra corresponds to the JSON schema field "extra_extra".
	ExtraExtra CliMatchExtraExtraExtra `json:"extra_extra,omitempty" yaml:"extra_extra,omitempty" mapstructure:"extra_extra,omitempty"`

	// Fingerprint corresponds to the JSON schema field "fingerprint".
	Fingerprint string `json:"fingerprint" yaml:"fingerprint" mapstructure:"fingerprint"`

	// Fix corresponds to the JSON schema field "fix".
	Fix *string `json:"fix,omitempty" yaml:"fix,omitempty" mapstructure:"fix,omitempty"`

	// FixRegex corresponds to the JSON schema field "fix_regex".
	FixRegex *FixRegex `json:"fix_regex,omitempty" yaml:"fix_regex,omitempty" mapstructure:"fix_regex,omitempty"`

	// FixedLines corresponds to the JSON schema field "fixed_lines".
	FixedLines []string `json:"fixed_lines,omitempty" yaml:"fixed_lines,omitempty" mapstructure:"fixed_lines,omitempty"`

	// IsIgnored corresponds to the JSON schema field "is_ignored".
	IsIgnored *bool `json:"is_ignored,omitempty" yaml:"is_ignored,omitempty" mapstructure:"is_ignored,omitempty"`

	// Lines corresponds to the JSON schema field "lines".
	Lines string `json:"lines" yaml:"lines" mapstructure:"lines"`

	// Message corresponds to the JSON schema field "message".
	Message string `json:"message" yaml:"message" mapstructure:"message"`

	// Metadata corresponds to the JSON schema field "metadata".
	Metadata CliMatchExtraMetadata `json:"metadata" yaml:"metadata" mapstructure:"metadata"`

	// Metavars corresponds to the JSON schema field "metavars".
	Metavars Metavars `json:"metavars,omitempty" yaml:"metavars,omitempty" mapstructure:"metavars,omitempty"`

	// ScaInfo corresponds to the JSON schema field "sca_info".
	ScaInfo *ScaInfo `json:"sca_info,omitempty" yaml:"sca_info,omitempty" mapstructure:"sca_info,omitempty"`

	// Severity corresponds to the JSON schema field "severity".
	Severity CliMatchExtraSeverity `json:"severity" yaml:"severity" mapstructure:"severity"`

	// ValidationState corresponds to the JSON schema field "validation_state".
	ValidationState CliMatchExtraValidationState `json:"validation_state,omitempty" yaml:"validation_state,omitempty" mapstructure:"validation_state,omitempty"`
}

func (*CliMatchExtra) UnmarshalJSON

func (j *CliMatchExtra) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CliMatchExtraEngineKind

type CliMatchExtraEngineKind interface{}

type CliMatchExtraExtraExtra

type CliMatchExtraExtraExtra interface{}

type CliMatchExtraMetadata

type CliMatchExtraMetadata interface{}

type CliMatchExtraSeverity

type CliMatchExtraSeverity interface{}

type CliMatchExtraValidationState

type CliMatchExtraValidationState interface{}

type CliOutputExtra

type CliOutputExtra struct {
	// EngineRequested corresponds to the JSON schema field "engine_requested".
	EngineRequested CliOutputExtraEngineRequested `json:"engine_requested,omitempty" yaml:"engine_requested,omitempty" mapstructure:"engine_requested,omitempty"`

	// Explanations corresponds to the JSON schema field "explanations".
	Explanations []MatchingExplanation `json:"explanations,omitempty" yaml:"explanations,omitempty" mapstructure:"explanations,omitempty"`

	// Paths corresponds to the JSON schema field "paths".
	Paths ScannedAndSkipped `json:"paths" yaml:"paths" mapstructure:"paths"`

	// RulesByEngine corresponds to the JSON schema field "rules_by_engine".
	RulesByEngine []RuleIdAndEngineKind `json:"rules_by_engine,omitempty" yaml:"rules_by_engine,omitempty" mapstructure:"rules_by_engine,omitempty"`

	// SkippedRules corresponds to the JSON schema field "skipped_rules".
	SkippedRules []SkippedRule `json:"skipped_rules,omitempty" yaml:"skipped_rules,omitempty" mapstructure:"skipped_rules,omitempty"`

	// Time corresponds to the JSON schema field "time".
	Time *Profile `json:"time,omitempty" yaml:"time,omitempty" mapstructure:"time,omitempty"`
}

func (*CliOutputExtra) UnmarshalJSON

func (j *CliOutputExtra) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CliOutputExtraEngineRequested

type CliOutputExtraEngineRequested interface{}

type Contribution

type Contribution struct {
	// CommitHash corresponds to the JSON schema field "commit_hash".
	CommitHash string `json:"commit_hash" yaml:"commit_hash" mapstructure:"commit_hash"`

	// CommitTimestamp corresponds to the JSON schema field "commit_timestamp".
	CommitTimestamp string `json:"commit_timestamp" yaml:"commit_timestamp" mapstructure:"commit_timestamp"`

	// Contributor corresponds to the JSON schema field "contributor".
	Contributor Contributor `json:"contributor" yaml:"contributor" mapstructure:"contributor"`
}

func (*Contribution) UnmarshalJSON

func (j *Contribution) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Contributions

type Contributions []Contribution

type Contributor

type Contributor struct {
	// CommitAuthorEmail corresponds to the JSON schema field "commit_author_email".
	CommitAuthorEmail string `json:"commit_author_email" yaml:"commit_author_email" mapstructure:"commit_author_email"`

	// CommitAuthorName corresponds to the JSON schema field "commit_author_name".
	CommitAuthorName string `json:"commit_author_name" yaml:"commit_author_name" mapstructure:"commit_author_name"`
}

func (*Contributor) UnmarshalJSON

func (j *Contributor) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CoreError

type CoreError struct {
	// Details corresponds to the JSON schema field "details".
	Details *string `json:"details,omitempty" yaml:"details,omitempty" mapstructure:"details,omitempty"`

	// ErrorType corresponds to the JSON schema field "error_type".
	ErrorType CoreErrorErrorType `json:"error_type" yaml:"error_type" mapstructure:"error_type"`

	// Location corresponds to the JSON schema field "location".
	Location Location `json:"location" yaml:"location" mapstructure:"location"`

	// Message corresponds to the JSON schema field "message".
	Message string `json:"message" yaml:"message" mapstructure:"message"`

	// RuleId corresponds to the JSON schema field "rule_id".
	RuleId *RuleId `json:"rule_id,omitempty" yaml:"rule_id,omitempty" mapstructure:"rule_id,omitempty"`

	// Severity corresponds to the JSON schema field "severity".
	Severity CoreErrorSeverity `json:"severity" yaml:"severity" mapstructure:"severity"`
}

func (*CoreError) UnmarshalJSON

func (j *CoreError) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CoreErrorErrorType

type CoreErrorErrorType interface{}

type CoreErrorSeverity

type CoreErrorSeverity interface{}

type CoreMatch

type CoreMatch struct {
	// CheckId corresponds to the JSON schema field "check_id".
	CheckId RuleId `json:"check_id" yaml:"check_id" mapstructure:"check_id"`

	// End corresponds to the JSON schema field "end".
	End Position `json:"end" yaml:"end" mapstructure:"end"`

	// Extra corresponds to the JSON schema field "extra".
	Extra CoreMatchExtra `json:"extra" yaml:"extra" mapstructure:"extra"`

	// Path corresponds to the JSON schema field "path".
	Path Fpath `json:"path" yaml:"path" mapstructure:"path"`

	// Start corresponds to the JSON schema field "start".
	Start Position `json:"start" yaml:"start" mapstructure:"start"`
}

func (*CoreMatch) UnmarshalJSON

func (j *CoreMatch) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CoreMatchExtra

type CoreMatchExtra struct {
	// DataflowTrace corresponds to the JSON schema field "dataflow_trace".
	DataflowTrace *MatchDataflowTrace `json:"dataflow_trace,omitempty" yaml:"dataflow_trace,omitempty" mapstructure:"dataflow_trace,omitempty"`

	// EngineKind corresponds to the JSON schema field "engine_kind".
	EngineKind CoreMatchExtraEngineKind `json:"engine_kind" yaml:"engine_kind" mapstructure:"engine_kind"`

	// ExtraExtra corresponds to the JSON schema field "extra_extra".
	ExtraExtra CoreMatchExtraExtraExtra `json:"extra_extra,omitempty" yaml:"extra_extra,omitempty" mapstructure:"extra_extra,omitempty"`

	// Message corresponds to the JSON schema field "message".
	Message *string `json:"message,omitempty" yaml:"message,omitempty" mapstructure:"message,omitempty"`

	// Metadata corresponds to the JSON schema field "metadata".
	Metadata CoreMatchExtraMetadata `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`

	// Metavars corresponds to the JSON schema field "metavars".
	Metavars Metavars `json:"metavars" yaml:"metavars" mapstructure:"metavars"`

	// RenderedFix corresponds to the JSON schema field "rendered_fix".
	RenderedFix *string `json:"rendered_fix,omitempty" yaml:"rendered_fix,omitempty" mapstructure:"rendered_fix,omitempty"`

	// Severity corresponds to the JSON schema field "severity".
	Severity CoreMatchExtraSeverity `json:"severity,omitempty" yaml:"severity,omitempty" mapstructure:"severity,omitempty"`

	// ValidationState corresponds to the JSON schema field "validation_state".
	ValidationState CoreMatchExtraValidationState `json:"validation_state,omitempty" yaml:"validation_state,omitempty" mapstructure:"validation_state,omitempty"`
}

func (*CoreMatchExtra) UnmarshalJSON

func (j *CoreMatchExtra) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CoreMatchExtraEngineKind

type CoreMatchExtraEngineKind interface{}

type CoreMatchExtraExtraExtra

type CoreMatchExtraExtraExtra interface{}

type CoreMatchExtraMetadata

type CoreMatchExtraMetadata interface{}

type CoreMatchExtraSeverity

type CoreMatchExtraSeverity interface{}

type CoreMatchExtraValidationState

type CoreMatchExtraValidationState interface{}

type CoreOutput

type CoreOutput struct {
	// EngineRequested corresponds to the JSON schema field "engine_requested".
	EngineRequested CoreOutputEngineRequested `json:"engine_requested,omitempty" yaml:"engine_requested,omitempty" mapstructure:"engine_requested,omitempty"`

	// Errors corresponds to the JSON schema field "errors".
	Errors []CoreError `json:"errors" yaml:"errors" mapstructure:"errors"`

	// Explanations corresponds to the JSON schema field "explanations".
	Explanations []MatchingExplanation `json:"explanations,omitempty" yaml:"explanations,omitempty" mapstructure:"explanations,omitempty"`

	// Paths corresponds to the JSON schema field "paths".
	Paths ScannedAndSkipped `json:"paths" yaml:"paths" mapstructure:"paths"`

	// Results corresponds to the JSON schema field "results".
	Results []CoreMatch `json:"results" yaml:"results" mapstructure:"results"`

	// RulesByEngine corresponds to the JSON schema field "rules_by_engine".
	RulesByEngine []RuleIdAndEngineKind `json:"rules_by_engine,omitempty" yaml:"rules_by_engine,omitempty" mapstructure:"rules_by_engine,omitempty"`

	// SkippedRules corresponds to the JSON schema field "skipped_rules".
	SkippedRules []SkippedRule `json:"skipped_rules,omitempty" yaml:"skipped_rules,omitempty" mapstructure:"skipped_rules,omitempty"`

	// Time corresponds to the JSON schema field "time".
	Time *Profile `json:"time,omitempty" yaml:"time,omitempty" mapstructure:"time,omitempty"`

	// Version corresponds to the JSON schema field "version".
	Version *Version `json:"version,omitempty" yaml:"version,omitempty" mapstructure:"version,omitempty"`
}

func (*CoreOutput) UnmarshalJSON

func (j *CoreOutput) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CoreOutputEngineRequested

type CoreOutputEngineRequested interface{}

type Datetime

type Datetime string

type DependencyChild

type DependencyChild struct {
	// Package corresponds to the JSON schema field "package".
	Package string `json:"package" yaml:"package" mapstructure:"package"`

	// Version corresponds to the JSON schema field "version".
	Version string `json:"version" yaml:"version" mapstructure:"version"`
}

func (*DependencyChild) UnmarshalJSON

func (j *DependencyChild) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DependencyMatch

type DependencyMatch struct {
	// DependencyPattern corresponds to the JSON schema field "dependency_pattern".
	DependencyPattern DependencyPattern `json:"dependency_pattern" yaml:"dependency_pattern" mapstructure:"dependency_pattern"`

	// FoundDependency corresponds to the JSON schema field "found_dependency".
	FoundDependency FoundDependency `json:"found_dependency" yaml:"found_dependency" mapstructure:"found_dependency"`

	// Lockfile corresponds to the JSON schema field "lockfile".
	Lockfile string `json:"lockfile" yaml:"lockfile" mapstructure:"lockfile"`
}

func (*DependencyMatch) UnmarshalJSON

func (j *DependencyMatch) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DependencyParserError

type DependencyParserError struct {
	// Col corresponds to the JSON schema field "col".
	Col *int `json:"col,omitempty" yaml:"col,omitempty" mapstructure:"col,omitempty"`

	// Line corresponds to the JSON schema field "line".
	Line *int `json:"line,omitempty" yaml:"line,omitempty" mapstructure:"line,omitempty"`

	// Parser corresponds to the JSON schema field "parser".
	Parser DependencyParserErrorParser `json:"parser" yaml:"parser" mapstructure:"parser"`

	// Path corresponds to the JSON schema field "path".
	Path string `json:"path" yaml:"path" mapstructure:"path"`

	// Reason corresponds to the JSON schema field "reason".
	Reason string `json:"reason" yaml:"reason" mapstructure:"reason"`

	// Text corresponds to the JSON schema field "text".
	Text *string `json:"text,omitempty" yaml:"text,omitempty" mapstructure:"text,omitempty"`
}

func (*DependencyParserError) UnmarshalJSON

func (j *DependencyParserError) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DependencyParserErrorParser

type DependencyParserErrorParser interface{}

type DependencyPattern

type DependencyPattern struct {
	// Ecosystem corresponds to the JSON schema field "ecosystem".
	Ecosystem DependencyPatternEcosystem `json:"ecosystem" yaml:"ecosystem" mapstructure:"ecosystem"`

	// Package corresponds to the JSON schema field "package".
	Package string `json:"package" yaml:"package" mapstructure:"package"`

	// SemverRange corresponds to the JSON schema field "semver_range".
	SemverRange string `json:"semver_range" yaml:"semver_range" mapstructure:"semver_range"`
}

func (*DependencyPattern) UnmarshalJSON

func (j *DependencyPattern) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DependencyPatternEcosystem

type DependencyPatternEcosystem interface{}

type DeploymentConfig

type DeploymentConfig struct {
	// DefaultUserRole corresponds to the JSON schema field "default_user_role".
	DefaultUserRole *string `json:"default_user_role,omitempty" yaml:"default_user_role,omitempty" mapstructure:"default_user_role,omitempty"`

	// DisplayName corresponds to the JSON schema field "display_name".
	DisplayName *string `json:"display_name,omitempty" yaml:"display_name,omitempty" mapstructure:"display_name,omitempty"`

	// HasAutofix corresponds to the JSON schema field "has_autofix".
	HasAutofix *bool `json:"has_autofix,omitempty" yaml:"has_autofix,omitempty" mapstructure:"has_autofix,omitempty"`

	// HasDeepsemgrep corresponds to the JSON schema field "has_deepsemgrep".
	HasDeepsemgrep *bool `json:"has_deepsemgrep,omitempty" yaml:"has_deepsemgrep,omitempty" mapstructure:"has_deepsemgrep,omitempty"`

	// HasDependencyQuery corresponds to the JSON schema field "has_dependency_query".
	HasDependencyQuery *bool `json:"has_dependency_query,omitempty" yaml:"has_dependency_query,omitempty" mapstructure:"has_dependency_query,omitempty"`

	// HasTriageViaComment corresponds to the JSON schema field
	// "has_triage_via_comment".
	HasTriageViaComment *bool `` /* 127-byte string literal not displayed */

	// Id corresponds to the JSON schema field "id".
	Id int `json:"id" yaml:"id" mapstructure:"id"`

	// Name corresponds to the JSON schema field "name".
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// OrganizationId corresponds to the JSON schema field "organization_id".
	OrganizationId *int `json:"organization_id,omitempty" yaml:"organization_id,omitempty" mapstructure:"organization_id,omitempty"`

	// ScmName corresponds to the JSON schema field "scm_name".
	ScmName *string `json:"scm_name,omitempty" yaml:"scm_name,omitempty" mapstructure:"scm_name,omitempty"`

	// Slug corresponds to the JSON schema field "slug".
	Slug *string `json:"slug,omitempty" yaml:"slug,omitempty" mapstructure:"slug,omitempty"`

	// SourceType corresponds to the JSON schema field "source_type".
	SourceType *string `json:"source_type,omitempty" yaml:"source_type,omitempty" mapstructure:"source_type,omitempty"`
}

func (*DeploymentConfig) UnmarshalJSON

func (j *DeploymentConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DeploymentResponse

type DeploymentResponse struct {
	// Deployment corresponds to the JSON schema field "deployment".
	Deployment DeploymentConfig `json:"deployment" yaml:"deployment" mapstructure:"deployment"`
}

func (*DeploymentResponse) UnmarshalJSON

func (j *DeploymentResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Ecosystem

type Ecosystem interface{}

type EngineKind

type EngineKind interface{}

type ErrorSeverity

type ErrorSeverity interface{}

type ErrorSpan

type ErrorSpan struct {
	// ConfigEnd corresponds to the JSON schema field "config_end".
	ConfigEnd *Position `json:"config_end,omitempty" yaml:"config_end,omitempty" mapstructure:"config_end,omitempty"`

	// ConfigPath corresponds to the JSON schema field "config_path".
	ConfigPath []string `json:"config_path,omitempty" yaml:"config_path,omitempty" mapstructure:"config_path,omitempty"`

	// ConfigStart corresponds to the JSON schema field "config_start".
	ConfigStart *Position `json:"config_start,omitempty" yaml:"config_start,omitempty" mapstructure:"config_start,omitempty"`

	// ContextEnd corresponds to the JSON schema field "context_end".
	ContextEnd *Position `json:"context_end,omitempty" yaml:"context_end,omitempty" mapstructure:"context_end,omitempty"`

	// ContextStart corresponds to the JSON schema field "context_start".
	ContextStart *Position `json:"context_start,omitempty" yaml:"context_start,omitempty" mapstructure:"context_start,omitempty"`

	// End corresponds to the JSON schema field "end".
	End Position `json:"end" yaml:"end" mapstructure:"end"`

	// File corresponds to the JSON schema field "file".
	File Fpath `json:"file" yaml:"file" mapstructure:"file"`

	// SourceHash corresponds to the JSON schema field "source_hash".
	SourceHash *string `json:"source_hash,omitempty" yaml:"source_hash,omitempty" mapstructure:"source_hash,omitempty"`

	// Start corresponds to the JSON schema field "start".
	Start Position `json:"start" yaml:"start" mapstructure:"start"`
}

func (*ErrorSpan) UnmarshalJSON

func (j *ErrorSpan) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ErrorType

type ErrorType interface{}

type Finding

type Finding struct {
	// CheckId corresponds to the JSON schema field "check_id".
	CheckId RuleId `json:"check_id" yaml:"check_id" mapstructure:"check_id"`

	// Column corresponds to the JSON schema field "column".
	Column int `json:"column" yaml:"column" mapstructure:"column"`

	// CommitDate corresponds to the JSON schema field "commit_date".
	CommitDate string `json:"commit_date" yaml:"commit_date" mapstructure:"commit_date"`

	// DataflowTrace corresponds to the JSON schema field "dataflow_trace".
	DataflowTrace *MatchDataflowTrace `json:"dataflow_trace,omitempty" yaml:"dataflow_trace,omitempty" mapstructure:"dataflow_trace,omitempty"`

	// EndColumn corresponds to the JSON schema field "end_column".
	EndColumn int `json:"end_column" yaml:"end_column" mapstructure:"end_column"`

	// EndLine corresponds to the JSON schema field "end_line".
	EndLine int `json:"end_line" yaml:"end_line" mapstructure:"end_line"`

	// FixedLines corresponds to the JSON schema field "fixed_lines".
	FixedLines []string `json:"fixed_lines,omitempty" yaml:"fixed_lines,omitempty" mapstructure:"fixed_lines,omitempty"`

	// Hashes corresponds to the JSON schema field "hashes".
	Hashes *FindingHashes `json:"hashes,omitempty" yaml:"hashes,omitempty" mapstructure:"hashes,omitempty"`

	// Index corresponds to the JSON schema field "index".
	Index int `json:"index" yaml:"index" mapstructure:"index"`

	// IsBlocking corresponds to the JSON schema field "is_blocking".
	IsBlocking bool `json:"is_blocking" yaml:"is_blocking" mapstructure:"is_blocking"`

	// Line corresponds to the JSON schema field "line".
	Line int `json:"line" yaml:"line" mapstructure:"line"`

	// MatchBasedId corresponds to the JSON schema field "match_based_id".
	MatchBasedId *string `json:"match_based_id,omitempty" yaml:"match_based_id,omitempty" mapstructure:"match_based_id,omitempty"`

	// Message corresponds to the JSON schema field "message".
	Message string `json:"message" yaml:"message" mapstructure:"message"`

	// Metadata corresponds to the JSON schema field "metadata".
	Metadata FindingMetadata `json:"metadata" yaml:"metadata" mapstructure:"metadata"`

	// Path corresponds to the JSON schema field "path".
	Path Fpath `json:"path" yaml:"path" mapstructure:"path"`

	// ScaInfo corresponds to the JSON schema field "sca_info".
	ScaInfo *ScaInfo `json:"sca_info,omitempty" yaml:"sca_info,omitempty" mapstructure:"sca_info,omitempty"`

	// Severity corresponds to the JSON schema field "severity".
	Severity interface{} `json:"severity" yaml:"severity" mapstructure:"severity"`

	// SyntacticId corresponds to the JSON schema field "syntactic_id".
	SyntacticId string `json:"syntactic_id" yaml:"syntactic_id" mapstructure:"syntactic_id"`

	// ValidationState corresponds to the JSON schema field "validation_state".
	ValidationState FindingValidationState `json:"validation_state,omitempty" yaml:"validation_state,omitempty" mapstructure:"validation_state,omitempty"`
}

func (*Finding) UnmarshalJSON

func (j *Finding) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type FindingHashes

type FindingHashes struct {
	// CodeHash corresponds to the JSON schema field "code_hash".
	CodeHash string `json:"code_hash" yaml:"code_hash" mapstructure:"code_hash"`

	// EndLineHash corresponds to the JSON schema field "end_line_hash".
	EndLineHash string `json:"end_line_hash" yaml:"end_line_hash" mapstructure:"end_line_hash"`

	// PatternHash corresponds to the JSON schema field "pattern_hash".
	PatternHash string `json:"pattern_hash" yaml:"pattern_hash" mapstructure:"pattern_hash"`

	// StartLineHash corresponds to the JSON schema field "start_line_hash".
	StartLineHash string `json:"start_line_hash" yaml:"start_line_hash" mapstructure:"start_line_hash"`
}

func (*FindingHashes) UnmarshalJSON

func (j *FindingHashes) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type FindingMetadata

type FindingMetadata interface{}

type FindingValidationState

type FindingValidationState interface{}

type FixRegex

type FixRegex struct {
	// Count corresponds to the JSON schema field "count".
	Count *int `json:"count,omitempty" yaml:"count,omitempty" mapstructure:"count,omitempty"`

	// Regex corresponds to the JSON schema field "regex".
	Regex string `json:"regex" yaml:"regex" mapstructure:"regex"`

	// Replacement corresponds to the JSON schema field "replacement".
	Replacement string `json:"replacement" yaml:"replacement" mapstructure:"replacement"`
}

func (*FixRegex) UnmarshalJSON

func (j *FixRegex) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type FoundDependency

type FoundDependency struct {
	// AllowedHashes corresponds to the JSON schema field "allowed_hashes".
	AllowedHashes FoundDependencyAllowedHashes `json:"allowed_hashes" yaml:"allowed_hashes" mapstructure:"allowed_hashes"`

	// Children corresponds to the JSON schema field "children".
	Children []DependencyChild `json:"children,omitempty" yaml:"children,omitempty" mapstructure:"children,omitempty"`

	// Ecosystem corresponds to the JSON schema field "ecosystem".
	Ecosystem FoundDependencyEcosystem `json:"ecosystem" yaml:"ecosystem" mapstructure:"ecosystem"`

	// LineNumber corresponds to the JSON schema field "line_number".
	LineNumber *int `json:"line_number,omitempty" yaml:"line_number,omitempty" mapstructure:"line_number,omitempty"`

	// Package corresponds to the JSON schema field "package".
	Package string `json:"package" yaml:"package" mapstructure:"package"`

	// ResolvedUrl corresponds to the JSON schema field "resolved_url".
	ResolvedUrl *string `json:"resolved_url,omitempty" yaml:"resolved_url,omitempty" mapstructure:"resolved_url,omitempty"`

	// Transitivity corresponds to the JSON schema field "transitivity".
	Transitivity FoundDependencyTransitivity `json:"transitivity" yaml:"transitivity" mapstructure:"transitivity"`

	// Version corresponds to the JSON schema field "version".
	Version string `json:"version" yaml:"version" mapstructure:"version"`
}

func (*FoundDependency) UnmarshalJSON

func (j *FoundDependency) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type FoundDependencyAllowedHashes

type FoundDependencyAllowedHashes map[string][]string

type FoundDependencyEcosystem

type FoundDependencyEcosystem interface{}

type FoundDependencyTransitivity

type FoundDependencyTransitivity interface{}

type Fpath

type Fpath string

type HitMap

type HitMap map[string]int

HitMap is a map of strings to ints. It's used to track hits for a given rule and/or file. The index is the ruleID or filename. The value is the number of times the rule was hit or the number of findings in the file.

func (HitMap) SortedData

func (m HitMap) SortedData(sortByCount bool) []HitMapRow

SortedData returns the HitMap data as a series of rows. If sortByCount is true, the data will be sorted by count, otherwise they will be sorted by key.

Note: Sorting by count is in descending order because most of the time we assume we want rules/files with higher hits first. Sorting by key is ascending order alphabetically.

func (HitMap) ToStringTable

func (m HitMap) ToStringTable(headers []string, sortByCount bool) string

Returns the HitMap data as a text table. This is useful for text printing. It's the caller's responsibility to pass the correct number of headers.

type HitMapRow

type HitMapRow struct {
	Key   string
	Value string
}

HitMapRow is a single row in the HitMap.

type IncompatibleRule

type IncompatibleRule struct {
	// MaxVersion corresponds to the JSON schema field "max_version".
	MaxVersion *Version `json:"max_version,omitempty" yaml:"max_version,omitempty" mapstructure:"max_version,omitempty"`

	// MinVersion corresponds to the JSON schema field "min_version".
	MinVersion *Version `json:"min_version,omitempty" yaml:"min_version,omitempty" mapstructure:"min_version,omitempty"`

	// RuleId corresponds to the JSON schema field "rule_id".
	RuleId RuleId `json:"rule_id" yaml:"rule_id" mapstructure:"rule_id"`

	// ThisVersion corresponds to the JSON schema field "this_version".
	ThisVersion Version `json:"this_version" yaml:"this_version" mapstructure:"this_version"`
}

func (*IncompatibleRule) UnmarshalJSON

func (j *IncompatibleRule) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Location

type Location struct {
	// End corresponds to the JSON schema field "end".
	End Position `json:"end" yaml:"end" mapstructure:"end"`

	// Path corresponds to the JSON schema field "path".
	Path Fpath `json:"path" yaml:"path" mapstructure:"path"`

	// Start corresponds to the JSON schema field "start".
	Start Position `json:"start" yaml:"start" mapstructure:"start"`
}

func (*Location) UnmarshalJSON

func (j *Location) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MatchCallTrace

type MatchCallTrace interface{}

type MatchDataflowTrace

type MatchDataflowTrace struct {
	// IntermediateVars corresponds to the JSON schema field "intermediate_vars".
	IntermediateVars []MatchIntermediateVar `json:"intermediate_vars,omitempty" yaml:"intermediate_vars,omitempty" mapstructure:"intermediate_vars,omitempty"`

	// TaintSink corresponds to the JSON schema field "taint_sink".
	TaintSink MatchDataflowTraceTaintSink `json:"taint_sink,omitempty" yaml:"taint_sink,omitempty" mapstructure:"taint_sink,omitempty"`

	// TaintSource corresponds to the JSON schema field "taint_source".
	TaintSource MatchDataflowTraceTaintSource `json:"taint_source,omitempty" yaml:"taint_source,omitempty" mapstructure:"taint_source,omitempty"`
}

type MatchDataflowTraceTaintSink

type MatchDataflowTraceTaintSink interface{}

type MatchDataflowTraceTaintSource

type MatchDataflowTraceTaintSource interface{}

type MatchIntermediateVar

type MatchIntermediateVar struct {
	// Content corresponds to the JSON schema field "content".
	Content string `json:"content" yaml:"content" mapstructure:"content"`

	// Location corresponds to the JSON schema field "location".
	Location Location `json:"location" yaml:"location" mapstructure:"location"`
}

func (*MatchIntermediateVar) UnmarshalJSON

func (j *MatchIntermediateVar) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MatchSeverity

type MatchSeverity interface{}

type MatchingExplanation

type MatchingExplanation struct {
	// Children corresponds to the JSON schema field "children".
	Children []*MatchingExplanation `json:"children" yaml:"children" mapstructure:"children"`

	// Loc corresponds to the JSON schema field "loc".
	Loc Location `json:"loc" yaml:"loc" mapstructure:"loc"`

	// Matches corresponds to the JSON schema field "matches".
	Matches []CoreMatch `json:"matches" yaml:"matches" mapstructure:"matches"`

	// Op corresponds to the JSON schema field "op".
	Op MatchingExplanationOp `json:"op" yaml:"op" mapstructure:"op"`
}

func (*MatchingExplanation) UnmarshalJSON

func (j *MatchingExplanation) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MatchingExplanationOp

type MatchingExplanationOp interface{}

type MatchingOperation

type MatchingOperation interface{}

type MetavarValue

type MetavarValue struct {
	// AbstractContent corresponds to the JSON schema field "abstract_content".
	AbstractContent string `json:"abstract_content" yaml:"abstract_content" mapstructure:"abstract_content"`

	// End corresponds to the JSON schema field "end".
	End Position `json:"end" yaml:"end" mapstructure:"end"`

	// PropagatedValue corresponds to the JSON schema field "propagated_value".
	PropagatedValue *SvalueValue `json:"propagated_value,omitempty" yaml:"propagated_value,omitempty" mapstructure:"propagated_value,omitempty"`

	// Start corresponds to the JSON schema field "start".
	Start Position `json:"start" yaml:"start" mapstructure:"start"`
}

func (*MetavarValue) UnmarshalJSON

func (j *MetavarValue) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Metavars

type Metavars map[string]MetavarValue

type Output

Create an alias for the entire struct.

func Deserialize

func Deserialize(data []byte) (Output, error)

Deserialize the JSON output to a Go struct.

func (Output) FilePathHitMap

func (o Output) FilePathHitMap(sortByCount bool) []HitMapRow

FilePathHitMap returns a slice of sorted HitMapRows. The key in each row is the file path and the value is the number of hits for that fule. if sortByCount is true, the slice is sorted by hits in descending order (e.g., ruleIDs with more hits first). Otherwise, the slice is sorted by file path alphabetically.

func (Output) FilePathTextReport

func (o Output) FilePathTextReport(sortByCount bool) string

FilePathStringTable returns a string table of sorted file paths and hits.

func (Output) GenericHTMLReport

func (o Output) GenericHTMLReport(tmpl string, output Output) (string, error)

Creates a generic HTMl report based on the template and Semgrep's JSON output. This function uses html/template which is safe* for HTML generation.

func (Output) GenericTextReport

func (o Output) GenericTextReport(tmpl string, output Output) (string, error)

Creates a generic text report based on the template and Semgrep's JSON output. Note, this function uses text/template which is not safe for HTML generation.

func (Output) RuleIDHitMap

func (o Output) RuleIDHitMap(sortByCount bool) []HitMapRow

RuleIDHitMap returns a slice of sorted HitMapRows. The key in each row is the ruleID and the value is the number of hits for that rule. if sortByCount is true, the slice is sorted by hits in descending order (e.g., ruleIDs with more hits first). Otherwise, the slice is sorted by ruleID alphabetically.

func (Output) RuleIDTextReport

func (o Output) RuleIDTextReport(sortByCount bool) string

RuleIDStringTable returns a string table of sorted ruleIDs and hits.

func (Output) Serialize

func (o Output) Serialize(beautify bool) ([]byte, error)

Serialize the Go struct to JSON. If beautify is true, the output is indented.

type ParsingStats

type ParsingStats struct {
	// BytesParsed corresponds to the JSON schema field "bytes_parsed".
	BytesParsed int `json:"bytes_parsed" yaml:"bytes_parsed" mapstructure:"bytes_parsed"`

	// NumBytes corresponds to the JSON schema field "num_bytes".
	NumBytes int `json:"num_bytes" yaml:"num_bytes" mapstructure:"num_bytes"`

	// NumTargets corresponds to the JSON schema field "num_targets".
	NumTargets int `json:"num_targets" yaml:"num_targets" mapstructure:"num_targets"`

	// TargetsParsed corresponds to the JSON schema field "targets_parsed".
	TargetsParsed int `json:"targets_parsed" yaml:"targets_parsed" mapstructure:"targets_parsed"`
}

func (*ParsingStats) UnmarshalJSON

func (j *ParsingStats) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Position

type Position struct {
	// Col corresponds to the JSON schema field "col".
	Col int `json:"col" yaml:"col" mapstructure:"col"`

	// Line corresponds to the JSON schema field "line".
	Line int `json:"line" yaml:"line" mapstructure:"line"`

	// Offset corresponds to the JSON schema field "offset".
	Offset *int `json:"offset,omitempty" yaml:"offset,omitempty" mapstructure:"offset,omitempty"`
}

func (*Position) UnmarshalJSON

func (j *Position) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Product

type Product interface{}

type Profile

type Profile struct {
	// MaxMemoryBytes corresponds to the JSON schema field "max_memory_bytes".
	MaxMemoryBytes *int `json:"max_memory_bytes,omitempty" yaml:"max_memory_bytes,omitempty" mapstructure:"max_memory_bytes,omitempty"`

	// ProfilingTimes corresponds to the JSON schema field "profiling_times".
	ProfilingTimes ProfileProfilingTimes `json:"profiling_times" yaml:"profiling_times" mapstructure:"profiling_times"`

	// Rules corresponds to the JSON schema field "rules".
	Rules []RuleId `json:"rules" yaml:"rules" mapstructure:"rules"`

	// RulesParseTime corresponds to the JSON schema field "rules_parse_time".
	RulesParseTime float64 `json:"rules_parse_time" yaml:"rules_parse_time" mapstructure:"rules_parse_time"`

	// Targets corresponds to the JSON schema field "targets".
	Targets []TargetTimes `json:"targets" yaml:"targets" mapstructure:"targets"`

	// TotalBytes corresponds to the JSON schema field "total_bytes".
	TotalBytes int `json:"total_bytes" yaml:"total_bytes" mapstructure:"total_bytes"`
}

func (*Profile) UnmarshalJSON

func (j *Profile) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ProfileProfilingTimes

type ProfileProfilingTimes map[string]float64

type ProjectMetadata

type ProjectMetadata struct {
	// BaseSha corresponds to the JSON schema field "base_sha".
	BaseSha *Sha1 `json:"base_sha,omitempty" yaml:"base_sha,omitempty" mapstructure:"base_sha,omitempty"`

	// Branch corresponds to the JSON schema field "branch".
	Branch *string `json:"branch" yaml:"branch" mapstructure:"branch"`

	// CiJobUrl corresponds to the JSON schema field "ci_job_url".
	CiJobUrl Uri `json:"ci_job_url" yaml:"ci_job_url" mapstructure:"ci_job_url"`

	// Commit corresponds to the JSON schema field "commit".
	Commit Sha1 `json:"commit" yaml:"commit" mapstructure:"commit"`

	// CommitAuthorEmail corresponds to the JSON schema field "commit_author_email".
	CommitAuthorEmail *string `json:"commit_author_email" yaml:"commit_author_email" mapstructure:"commit_author_email"`

	// CommitAuthorImageUrl corresponds to the JSON schema field
	// "commit_author_image_url".
	CommitAuthorImageUrl Uri `json:"commit_author_image_url" yaml:"commit_author_image_url" mapstructure:"commit_author_image_url"`

	// CommitAuthorName corresponds to the JSON schema field "commit_author_name".
	CommitAuthorName *string `json:"commit_author_name" yaml:"commit_author_name" mapstructure:"commit_author_name"`

	// CommitAuthorUsername corresponds to the JSON schema field
	// "commit_author_username".
	CommitAuthorUsername *string `json:"commit_author_username" yaml:"commit_author_username" mapstructure:"commit_author_username"`

	// CommitTimestamp corresponds to the JSON schema field "commit_timestamp".
	CommitTimestamp *string `json:"commit_timestamp,omitempty" yaml:"commit_timestamp,omitempty" mapstructure:"commit_timestamp,omitempty"`

	// CommitTitle corresponds to the JSON schema field "commit_title".
	CommitTitle *string `json:"commit_title" yaml:"commit_title" mapstructure:"commit_title"`

	// IsCodeScan corresponds to the JSON schema field "is_code_scan".
	IsCodeScan *bool `json:"is_code_scan,omitempty" yaml:"is_code_scan,omitempty" mapstructure:"is_code_scan,omitempty"`

	// IsFullScan corresponds to the JSON schema field "is_full_scan".
	IsFullScan bool `json:"is_full_scan" yaml:"is_full_scan" mapstructure:"is_full_scan"`

	// IsScaScan corresponds to the JSON schema field "is_sca_scan".
	IsScaScan *bool `json:"is_sca_scan,omitempty" yaml:"is_sca_scan,omitempty" mapstructure:"is_sca_scan,omitempty"`

	// IsSecretsScan corresponds to the JSON schema field "is_secrets_scan".
	IsSecretsScan *bool `json:"is_secrets_scan,omitempty" yaml:"is_secrets_scan,omitempty" mapstructure:"is_secrets_scan,omitempty"`

	// On corresponds to the JSON schema field "on".
	On string `json:"on" yaml:"on" mapstructure:"on"`

	// OrgId corresponds to the JSON schema field "org_id".
	OrgId *string `json:"org_id,omitempty" yaml:"org_id,omitempty" mapstructure:"org_id,omitempty"`

	// PullRequestAuthorImageUrl corresponds to the JSON schema field
	// "pull_request_author_image_url".
	PullRequestAuthorImageUrl Uri `json:"pull_request_author_image_url" yaml:"pull_request_author_image_url" mapstructure:"pull_request_author_image_url"`

	// PullRequestAuthorUsername corresponds to the JSON schema field
	// "pull_request_author_username".
	PullRequestAuthorUsername *string `json:"pull_request_author_username" yaml:"pull_request_author_username" mapstructure:"pull_request_author_username"`

	// PullRequestId corresponds to the JSON schema field "pull_request_id".
	PullRequestId *string `json:"pull_request_id" yaml:"pull_request_id" mapstructure:"pull_request_id"`

	// PullRequestTitle corresponds to the JSON schema field "pull_request_title".
	PullRequestTitle *string `json:"pull_request_title" yaml:"pull_request_title" mapstructure:"pull_request_title"`

	// RepoId corresponds to the JSON schema field "repo_id".
	RepoId *string `json:"repo_id,omitempty" yaml:"repo_id,omitempty" mapstructure:"repo_id,omitempty"`

	// RepoUrl corresponds to the JSON schema field "repo_url".
	RepoUrl Uri `json:"repo_url" yaml:"repo_url" mapstructure:"repo_url"`

	// Repository corresponds to the JSON schema field "repository".
	Repository string `json:"repository" yaml:"repository" mapstructure:"repository"`

	// ScanEnvironment corresponds to the JSON schema field "scan_environment".
	ScanEnvironment string `json:"scan_environment" yaml:"scan_environment" mapstructure:"scan_environment"`

	// SemgrepVersion corresponds to the JSON schema field "semgrep_version".
	SemgrepVersion Version `json:"semgrep_version" yaml:"semgrep_version" mapstructure:"semgrep_version"`

	// StartSha corresponds to the JSON schema field "start_sha".
	StartSha *Sha1 `json:"start_sha,omitempty" yaml:"start_sha,omitempty" mapstructure:"start_sha,omitempty"`
}

func (*ProjectMetadata) UnmarshalJSON

func (j *ProjectMetadata) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RawJson

type RawJson interface{}

type RuleId

type RuleId string

type RuleIdAndEngineKind

type RuleIdAndEngineKind []interface{}

type ScaInfo

type ScaInfo struct {
	// DependencyMatch corresponds to the JSON schema field "dependency_match".
	DependencyMatch DependencyMatch `json:"dependency_match" yaml:"dependency_match" mapstructure:"dependency_match"`

	// ReachabilityRule corresponds to the JSON schema field "reachability_rule".
	ReachabilityRule bool `json:"reachability_rule" yaml:"reachability_rule" mapstructure:"reachability_rule"`

	// Reachable corresponds to the JSON schema field "reachable".
	Reachable bool `json:"reachable" yaml:"reachable" mapstructure:"reachable"`

	// ScaFindingSchema corresponds to the JSON schema field "sca_finding_schema".
	ScaFindingSchema int `json:"sca_finding_schema" yaml:"sca_finding_schema" mapstructure:"sca_finding_schema"`
}

func (*ScaInfo) UnmarshalJSON

func (j *ScaInfo) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ScaParserName

type ScaParserName interface{}

type ScanConfig

type ScanConfig struct {
	// Autofix corresponds to the JSON schema field "autofix".
	Autofix *bool `json:"autofix,omitempty" yaml:"autofix,omitempty" mapstructure:"autofix,omitempty"`

	// CiConfigFromCloud corresponds to the JSON schema field "ci_config_from_cloud".
	CiConfigFromCloud *CiConfigFromCloud `json:"ci_config_from_cloud,omitempty" yaml:"ci_config_from_cloud,omitempty" mapstructure:"ci_config_from_cloud,omitempty"`

	// Deepsemgrep corresponds to the JSON schema field "deepsemgrep".
	Deepsemgrep *bool `json:"deepsemgrep,omitempty" yaml:"deepsemgrep,omitempty" mapstructure:"deepsemgrep,omitempty"`

	// DependencyQuery corresponds to the JSON schema field "dependency_query".
	DependencyQuery *bool `json:"dependency_query,omitempty" yaml:"dependency_query,omitempty" mapstructure:"dependency_query,omitempty"`

	// DeploymentId corresponds to the JSON schema field "deployment_id".
	DeploymentId int `json:"deployment_id" yaml:"deployment_id" mapstructure:"deployment_id"`

	// DeploymentName corresponds to the JSON schema field "deployment_name".
	DeploymentName string `json:"deployment_name" yaml:"deployment_name" mapstructure:"deployment_name"`

	// EnabledProducts corresponds to the JSON schema field "enabled_products".
	EnabledProducts []ScanConfigEnabledProductsElem `json:"enabled_products,omitempty" yaml:"enabled_products,omitempty" mapstructure:"enabled_products,omitempty"`

	// IgnoredFiles corresponds to the JSON schema field "ignored_files".
	IgnoredFiles []string `json:"ignored_files,omitempty" yaml:"ignored_files,omitempty" mapstructure:"ignored_files,omitempty"`

	// PolicyNames corresponds to the JSON schema field "policy_names".
	PolicyNames []string `json:"policy_names" yaml:"policy_names" mapstructure:"policy_names"`

	// RuleConfig corresponds to the JSON schema field "rule_config".
	RuleConfig string `json:"rule_config" yaml:"rule_config" mapstructure:"rule_config"`

	// TriageIgnoredMatchBasedIds corresponds to the JSON schema field
	// "triage_ignored_match_based_ids".
	TriageIgnoredMatchBasedIds []string `` /* 151-byte string literal not displayed */

	// TriageIgnoredSyntacticIds corresponds to the JSON schema field
	// "triage_ignored_syntactic_ids".
	TriageIgnoredSyntacticIds []string `` /* 145-byte string literal not displayed */
}

func (*ScanConfig) UnmarshalJSON

func (j *ScanConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ScanConfigEnabledProductsElem

type ScanConfigEnabledProductsElem interface{}

type ScanMetadata

type ScanMetadata struct {
	// CliVersion corresponds to the JSON schema field "cli_version".
	CliVersion Version `json:"cli_version" yaml:"cli_version" mapstructure:"cli_version"`

	// RequestedProducts corresponds to the JSON schema field "requested_products".
	RequestedProducts []ScanMetadataRequestedProductsElem `json:"requested_products" yaml:"requested_products" mapstructure:"requested_products"`

	// UniqueId corresponds to the JSON schema field "unique_id".
	UniqueId Uuid `json:"unique_id" yaml:"unique_id" mapstructure:"unique_id"`
}

func (*ScanMetadata) UnmarshalJSON

func (j *ScanMetadata) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ScanMetadataRequestedProductsElem

type ScanMetadataRequestedProductsElem interface{}

type ScanRequest

type ScanRequest struct {
	// Meta corresponds to the JSON schema field "meta".
	Meta ScanRequestMeta `json:"meta" yaml:"meta" mapstructure:"meta"`

	// ProjectConfig corresponds to the JSON schema field "project_config".
	ProjectConfig *CiConfigFromRepo `json:"project_config,omitempty" yaml:"project_config,omitempty" mapstructure:"project_config,omitempty"`

	// ProjectMetadata corresponds to the JSON schema field "project_metadata".
	ProjectMetadata *ProjectMetadata `json:"project_metadata,omitempty" yaml:"project_metadata,omitempty" mapstructure:"project_metadata,omitempty"`

	// ScanMetadata corresponds to the JSON schema field "scan_metadata".
	ScanMetadata *ScanMetadata `json:"scan_metadata,omitempty" yaml:"scan_metadata,omitempty" mapstructure:"scan_metadata,omitempty"`
}

func (*ScanRequest) UnmarshalJSON

func (j *ScanRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ScanRequestMeta

type ScanRequestMeta interface{}

type ScannedAndSkipped

type ScannedAndSkipped struct {
	// Scanned corresponds to the JSON schema field "scanned".
	Scanned []Fpath `json:"scanned" yaml:"scanned" mapstructure:"scanned"`

	// Skipped corresponds to the JSON schema field "skipped".
	Skipped []SkippedTarget `json:"skipped,omitempty" yaml:"skipped,omitempty" mapstructure:"skipped,omitempty"`
}

func (*ScannedAndSkipped) UnmarshalJSON

func (j *ScannedAndSkipped) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SemgrepOutputV1Jsonschema

type SemgrepOutputV1Jsonschema struct {
	// EngineRequested corresponds to the JSON schema field "engine_requested".
	EngineRequested SemgrepOutputV1JsonschemaEngineRequested `json:"engine_requested,omitempty" yaml:"engine_requested,omitempty" mapstructure:"engine_requested,omitempty"`

	// Errors corresponds to the JSON schema field "errors".
	Errors []CliError `json:"errors" yaml:"errors" mapstructure:"errors"`

	// Explanations corresponds to the JSON schema field "explanations".
	Explanations []MatchingExplanation `json:"explanations,omitempty" yaml:"explanations,omitempty" mapstructure:"explanations,omitempty"`

	// Paths corresponds to the JSON schema field "paths".
	Paths ScannedAndSkipped `json:"paths" yaml:"paths" mapstructure:"paths"`

	// Results corresponds to the JSON schema field "results".
	Results []CliMatch `json:"results" yaml:"results" mapstructure:"results"`

	// RulesByEngine corresponds to the JSON schema field "rules_by_engine".
	RulesByEngine []RuleIdAndEngineKind `json:"rules_by_engine,omitempty" yaml:"rules_by_engine,omitempty" mapstructure:"rules_by_engine,omitempty"`

	// SkippedRules corresponds to the JSON schema field "skipped_rules".
	SkippedRules []SkippedRule `json:"skipped_rules,omitempty" yaml:"skipped_rules,omitempty" mapstructure:"skipped_rules,omitempty"`

	// Time corresponds to the JSON schema field "time".
	Time *Profile `json:"time,omitempty" yaml:"time,omitempty" mapstructure:"time,omitempty"`

	// Version corresponds to the JSON schema field "version".
	Version *Version `json:"version,omitempty" yaml:"version,omitempty" mapstructure:"version,omitempty"`
}

Translated by atdcat from 'semgrep_output_v1.atd'.

func (*SemgrepOutputV1Jsonschema) UnmarshalJSON

func (j *SemgrepOutputV1Jsonschema) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SemgrepOutputV1JsonschemaEngineRequested

type SemgrepOutputV1JsonschemaEngineRequested interface{}

type Sha1

type Sha1 string

type SkipReason

type SkipReason interface{}

type SkippedRule

type SkippedRule struct {
	// Details corresponds to the JSON schema field "details".
	Details string `json:"details" yaml:"details" mapstructure:"details"`

	// Position corresponds to the JSON schema field "position".
	Position Position `json:"position" yaml:"position" mapstructure:"position"`

	// RuleId corresponds to the JSON schema field "rule_id".
	RuleId RuleId `json:"rule_id" yaml:"rule_id" mapstructure:"rule_id"`
}

func (*SkippedRule) UnmarshalJSON

func (j *SkippedRule) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SkippedTarget

type SkippedTarget struct {
	// Details corresponds to the JSON schema field "details".
	Details *string `json:"details,omitempty" yaml:"details,omitempty" mapstructure:"details,omitempty"`

	// Path corresponds to the JSON schema field "path".
	Path Fpath `json:"path" yaml:"path" mapstructure:"path"`

	// Reason corresponds to the JSON schema field "reason".
	Reason SkippedTargetReason `json:"reason" yaml:"reason" mapstructure:"reason"`

	// RuleId corresponds to the JSON schema field "rule_id".
	RuleId *RuleId `json:"rule_id,omitempty" yaml:"rule_id,omitempty" mapstructure:"rule_id,omitempty"`
}

func (*SkippedTarget) UnmarshalJSON

func (j *SkippedTarget) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SkippedTargetReason

type SkippedTargetReason interface{}

type SvalueValue

type SvalueValue struct {
	// SvalueAbstractContent corresponds to the JSON schema field
	// "svalue_abstract_content".
	SvalueAbstractContent string `json:"svalue_abstract_content" yaml:"svalue_abstract_content" mapstructure:"svalue_abstract_content"`

	// SvalueEnd corresponds to the JSON schema field "svalue_end".
	SvalueEnd *Position `json:"svalue_end,omitempty" yaml:"svalue_end,omitempty" mapstructure:"svalue_end,omitempty"`

	// SvalueStart corresponds to the JSON schema field "svalue_start".
	SvalueStart *Position `json:"svalue_start,omitempty" yaml:"svalue_start,omitempty" mapstructure:"svalue_start,omitempty"`
}

func (*SvalueValue) UnmarshalJSON

func (j *SvalueValue) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Tag

type Tag string

type TargetTimes

type TargetTimes struct {
	// MatchTimes corresponds to the JSON schema field "match_times".
	MatchTimes []float64 `json:"match_times" yaml:"match_times" mapstructure:"match_times"`

	// NumBytes corresponds to the JSON schema field "num_bytes".
	NumBytes int `json:"num_bytes" yaml:"num_bytes" mapstructure:"num_bytes"`

	// ParseTimes corresponds to the JSON schema field "parse_times".
	ParseTimes []float64 `json:"parse_times" yaml:"parse_times" mapstructure:"parse_times"`

	// Path corresponds to the JSON schema field "path".
	Path Fpath `json:"path" yaml:"path" mapstructure:"path"`

	// RunTime corresponds to the JSON schema field "run_time".
	RunTime float64 `json:"run_time" yaml:"run_time" mapstructure:"run_time"`
}

func (*TargetTimes) UnmarshalJSON

func (j *TargetTimes) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Transitivity

type Transitivity interface{}

type Uri

type Uri string

type Uuid

type Uuid string

type ValidationState

type ValidationState interface{}

type Version

type Version string

Jump to

Keyboard shortcuts

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