processor

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 0 Imported by: 3 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Blob              []byte
	Type              DocumentType
	Format            FormatType
	SourceInformation SourceInformation
}

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"
	DocumentDSSE             DocumentType = "DSSE"
	DocumentSPDX             DocumentType = "SPDX"
	DocumentJsonLines        DocumentType = "JSON_LINES"
	DocumentScorecard        DocumentType = "SCORECARD"
	DocumentCycloneDX        DocumentType = "CycloneDX"
	DocumentDepsDev          DocumentType = "DEPS_DEV"
	DocumentCsaf             DocumentType = "CSAF"
	DocumentIngestPredicates DocumentType = "INGEST_PREDICATES"
	DocumentUnknown          DocumentType = "UNKNOWN"
)

Document* is the enumerables of DocumentType

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
}

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