processor

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EncodingExts = map[string]EncodingType{
	".bz2": EncodingBzip2,
	".zst": EncodingZstd,
}

Functions

This section is empty.

Types

type Document

type Document struct {
	Blob              []byte
	Type              DocumentType
	Format            FormatType
	Encoding          EncodingType
	SourceInformation SourceInformation
	ChildLogger       *zap.SugaredLogger
}

Document describes the input for a processor to run. This input can come from a collector or from the processor itself (run recursively).

type DocumentNode

type DocumentNode struct {
	Document *Document
	Children []*DocumentNode
}

DocumentNode describes a node of a DocumentTree

type DocumentProcessor

type DocumentProcessor interface {
	// ValidateSchema validates the schema of the document
	ValidateSchema(i *Document) error

	// Unpack takes in the document and tries to unpack it
	// if there is a valid decomposition of sub-documents.
	//
	// For example, a DSSE envelope or a tarball
	// Returns list of len=0 and nil error if nothing to unpack
	// Returns unpacked list and nil error if successfully unpacked
	Unpack(i *Document) ([]*Document, error)
}

type DocumentTree

type DocumentTree *DocumentNode

DocumentTree describes the output of a document tree that resulted from processing a node

type DocumentType

type DocumentType string

DocumentType describes the type of the document contents for schema checks

const (
	DocumentITE6SLSA    DocumentType = "SLSA"
	DocumentITE6Generic DocumentType = "ITE6"
	DocumentITE6Vul     DocumentType = "ITE6VUL"
	DocumentITE6EOL     DocumentType = "ITE6EOL"
	// ClearlyDefined
	DocumentITE6ClearlyDefined DocumentType = "ITE6CD"
	DocumentDSSE               DocumentType = "DSSE"
	DocumentSPDX               DocumentType = "SPDX"
	DocumentOpaque             DocumentType = "OPAQUE"
	DocumentScorecard          DocumentType = "SCORECARD"
	DocumentCycloneDX          DocumentType = "CycloneDX"
	DocumentDepsDev            DocumentType = "DEPS_DEV"
	DocumentCsaf               DocumentType = "CSAF"
	DocumentOpenVEX            DocumentType = "OPEN_VEX"
	DocumentIngestPredicates   DocumentType = "INGEST_PREDICATES"
	DocumentUnknown            DocumentType = "UNKNOWN"
)

Document* is the enumerables of DocumentType

type EncodingType added in v0.2.0

type EncodingType string
const (
	EncodingBzip2   EncodingType = "BZIP2"
	EncodingZstd    EncodingType = "ZSTD"
	EncodingUnknown EncodingType = "UNKNOWN"
)

type FormatType

type FormatType string

FormatType describes the document format for malform checks

const (
	FormatJSON      FormatType = "JSON"
	FormatJSONLines FormatType = "JSON_LINES"
	FormatXML       FormatType = "XML"
	FormatUnknown   FormatType = "UNKNOWN"
)

Format* is the enumerables of FormatType

type SourceInformation

type SourceInformation struct {
	// Collector describes the name of the collector providing this information
	Collector string
	// Source describes the source which the collector got this information
	Source string
	// DocumentRef describes the location of the document in the blob store
	DocumentRef string
}

SourceInformation provides additional information about where the document comes from

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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