Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWrongEncoding = errors.New("wrong data encoding, should be text/json")
View Source
var Parsers = ParsersList{ protobom.PredicateType: protobom.New(), spdx.PredicateType: spdx.New(), cyclonedx.PredicateType: cyclonedx.New(), ampel.PredicateTypePolicy: ampel.NewParserPolicyPredicate(), ampel.PredicateTypePolicyGroup: ampel.NewParserPolicyGroupPredicate(), ampel.PredicateTypePolicySet: ampel.NewParserPolicySetPredicate(), ampel.PredicateTypeResult: ampel.NewParserResultPredicate(), ampel.PredicateTypeResultSet: ampel.NewParserResultSetPredicate(), ampel.PredicateTypeResultGroup: ampel.NewParserResultGroupPredicate(), vulns.PredicateType: vulns.New(), trivy.PredicateType: trivy.New(), osv.PredicateType: osv.New(), openvex.PredicateType: openvex.New(), openvex.PredicateType02: openvex.New(), openeox.PredicateTypeCore: openeox.New(), openeox.PredicateTypeShell: openeox.New(), slsa.PredicateType10: slsa.NewParserV10(), slsa.PredicateType11: slsa.NewParserV11(), slsa.PredicateType02: slsa.NewParserV02(), vsa.PredicateType: vsa.NewParser(), }
Parsers
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Default to JSON will cause the predicate to be parsed as
// plain JSON is no parser can handle it.
DefaultToJSON bool
// TypeHints is an array of types that defines which parser will be tried.
// If no TypeHints are defined, ampel will try to parse the predicate with
// all loaded parsers.
TypeHints []attestation.PredicateType
}
type ParseOption ¶
type ParseOption func(*Options)
func WithDefaulToJSON ¶
func WithDefaulToJSON(sino bool) ParseOption
func WithTypeHints ¶
func WithTypeHints(hints []attestation.PredicateType) ParseOption
type ParsersList ¶
type ParsersList map[attestation.PredicateType]attestation.PredicateParser
func (*ParsersList) GetTypeParsers ¶
func (pl *ParsersList) GetTypeParsers(predicateTypes []attestation.PredicateType) *ParsersList
func (*ParsersList) Parse ¶
func (pl *ParsersList) Parse(data []byte, optFn ...ParseOption) (attestation.Predicate, error)
Parse gets a byte slice with a predicate and tries to parse ir with the loaded parsers.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package generic is a generic predicate that can be used as a wrapper for most predicate payloads
|
Package generic is a generic predicate that can be used as a wrapper for most predicate payloads |
Click to show internal directories.
Click to hide internal directories.