types

package
v0.4.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SigstoreFormatUnknown    SigstoreFormat = iota
	SigstoreFormatProvenance                // SLSA Provenance format

	SigstoreFormatUnknownName    = "unknown"
	SigstoreFormatProvenanceName = "provenance"
)
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")
)
View Source
var (
	ErrorNotSupported = errors.New("not supported")
)

Functions

func GetSigstoreFormatNames added in v0.3.4

func GetSigstoreFormatNames() []string

GetSigstoreFormatNames returns the names of the supported formats.

func GetSourceFormatNames

func GetSourceFormatNames() []string

GetSourceFormatNames returns the names of the supported source formats.

Types

type AttestationOptions added in v0.4.0

type AttestationOptions 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

	// Quiet suppresses output
	Quiet bool
}

AttestationOptions are the options for importing an attestation.

func (*AttestationOptions) Validate added in v0.4.0

func (o *AttestationOptions) Validate() error

Validate validates the options.

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 NoteOccurrencesMap added in v0.4.3

type NoteOccurrencesMap map[string]NoteOccurrences

type Options added in v0.4.3

type Options interface {
	Validate() error
}

type SigstoreFormat added in v0.3.4

type SigstoreFormat int64

SigstoreFormat represents the metatdata format.

func GetSigstoreFormats added in v0.3.4

func GetSigstoreFormats() []SigstoreFormat

GetSigstoreFormats returns the supported formats.

func ParseSigstoreFormat added in v0.3.4

func ParseSigstoreFormat(s string) (SigstoreFormat, error)

ParseSigstoreFormat parses the format.

func (SigstoreFormat) String added in v0.3.4

func (f SigstoreFormat) String() string

String returns the string representation of the format.

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.

type VulnerabilityOptions added in v0.4.0

type VulnerabilityOptions 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 (*VulnerabilityOptions) Validate added in v0.4.0

func (o *VulnerabilityOptions) Validate() error

Jump to

Keyboard shortcuts

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