predicate

package
v0.3.17 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

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

View Source
var ErrWrongEncoding = errors.New("wrong data encoding, should be text/json")

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

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
Package spdx3 parses SPDX 3 documents into a native predicate.
Package spdx3 parses SPDX 3 documents into a native predicate.

Jump to

Keyboard shortcuts

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