processor

package
v0.3.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FormatUnknown   Format = iota
	FormatGrypeJSON        // grype JSON format
	FormatTrivyJSON        // trivy JSON format
	FormatSnykJSON         // snyk JSON format

	FormatUnknownName   = "unknown"
	FormatGrypeJSONName = "grype"
	FormatTrivyJSONName = "trivy"
	FormatSnykJSONName  = "snyk"
)
View Source
const (
	TestProjectID = "test"
)

Variables

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

Functions

func GetFormatNames

func GetFormatNames() []string

GetFormatNames returns the names of the supported source formats.

func Process

func Process(opt *Options) error

func Unique

func Unique[T Hashible](list []T) []T

Types

type Format

type Format int64

Format represents the source format.

func GetFormats

func GetFormats() []Format

GetFormats returns the supported source formats.

func ParseFormat

func ParseFormat(s string) (Format, error)

ParseFormat parses the source format.

func (Format) String

func (f Format) String() string

String returns the string representation of the source format.

type Hashible

type Hashible interface {
	GetSHA256() string
}

type Options

type Options struct {
	// 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 *string

	// FormatType is the type of the format (e.g. json, yaml, etc.).
	FormatType Format

	// Output path (optional).
	Output *string

	// CSV indicates that the output should be in CSV format.
	CSV bool
	// contains filtered or unexported fields
}

Options represents the input options.

type VulnerabilityMapper

type VulnerabilityMapper func(c *gabs.Container) ([]*data.Vulnerability, error)

VulnerabilityMapper is a function that converts a source to a list of common vulnerability types.

Jump to

Keyboard shortcuts

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