types

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceFormatUnknown   SourceFormat = iota
	SourceFormatGrypeJSON              // grype JSON format
	SourceFormatTrivyJSON              // trivy JSON format
	SourceFormatSnykJSON               // snyk JSON format

	SourceFormatUnknownName   = "unknown"
	SourceFormatGrypeJSONName = "grype"
	SourceFormatTrivyJSONName = "trivy"
	SourceFormatSnykJSONName  = "snyk"
)
View Source
const (
	TestProjectID = "test"
)

Variables

View Source
var (
	ErrMissingProject = errors.New("missing project")
	ErrMissingFormat  = errors.New("missing format")
	ErrMissingPath    = errors.New("missing path")
	ErrMissingSource  = errors.New("missing source")
	ErrInvalidSource  = errors.New("invalid source")
)

Functions

func GetSourceFormatNames

func GetSourceFormatNames() []string

GetSourceFormatNames returns the names of the supported source formats.

Types

type ImportOptions

type ImportOptions struct {
	// Project is the ID of the project to import the report into.
	Project string

	// Source is the URI of the image from which the report was generated.
	Source string

	// File path to the vulnerability report to import.
	File string

	// Format of the file to import.
	Format SourceFormat

	// Quiet suppresses output
	Quiet bool
}

func (*ImportOptions) Validate

func (i *ImportOptions) Validate() error

type NoteOccurrences

type NoteOccurrences struct {
	// Note that the list of Occurrences points to.
	Note *g.Note

	// Occurrences that belong to the Note.
	Occurrences []*g.Occurrence
}

NoteOccurrences is a helper struct to hold Note and Occurrences.

type SourceFormat

type SourceFormat int64

SourceFormat represents the source format.

func GetSourceFormats

func GetSourceFormats() []SourceFormat

GetSourceFormats returns the supported source formats.

func ParseSourceFormat

func ParseSourceFormat(s string) (SourceFormat, error)

ParseSourceFormat parses the source format.

func (SourceFormat) String

func (f SourceFormat) String() string

String returns the string representation of the source format.

Jump to

Keyboard shortcuts

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