predicate

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

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

Jump to

Keyboard shortcuts

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