Documentation ¶
Index ¶
- Constants
- func EachRef[U comparable, V comparable](a *Result[U], b *Result[V], fn func(U, V) error) (err error)
- func FromDigestMap(m map[string]string) []digest.Digest
- func ToDigestMap(ds ...digest.Digest) map[string]string
- type Attestation
- type InTotoAttestation
- type InTotoSubject
- type Result
- func (r *Result[T]) AddAttestation(k string, v Attestation[T])
- func (r *Result[T]) AddMeta(k string, v []byte)
- func (r *Result[T]) AddRef(k string, ref T)
- func (r *Result[T]) Clone() *Result[T]
- func (r *Result[T]) EachRef(fn func(T) error) (err error)
- func (r *Result[T]) FindRef(key string) (T, bool)
- func (r *Result[T]) SetRef(ref T)
- func (r *Result[T]) SingleRef() (T, error)
Constants ¶
View Source
const ( AttestationReasonKey = "reason" AttestationSBOMCore = "sbom-core" AttestationInlineOnlyKey = "inline-only" )
View Source
const ( AttestationReasonSBOM = "sbom" AttestationReasonProvenance = "provenance" )
Variables ¶
This section is empty.
Functions ¶
func EachRef ¶
func EachRef[U comparable, V comparable](a *Result[U], b *Result[V], fn func(U, V) error) (err error)
EachRef iterates over references in both a and b. a and b are assumed to be of the same size and map their references to the same set of keys
Types ¶
type Attestation ¶
type Attestation[T any] struct { Kind pb.AttestationKind Metadata map[string][]byte Ref T Path string ContentFunc func() ([]byte, error) InToto InTotoAttestation }
func ConvertAttestation ¶
func ConvertAttestation[U comparable, V comparable](a *Attestation[U], fn func(U) (V, error)) (*Attestation[V], error)
type InTotoAttestation ¶
type InTotoAttestation struct { PredicateType string Subjects []InTotoSubject }
type InTotoSubject ¶
type InTotoSubject struct { Kind pb.InTotoSubjectKind Name string Digest []digest.Digest }
type Result ¶
type Result[T comparable] struct { Ref T Refs map[string]T Metadata map[string][]byte Attestations map[string][]Attestation[T] // contains filtered or unexported fields }
func ConvertResult ¶
func ConvertResult[U comparable, V comparable](r *Result[U], fn func(U) (V, error)) (*Result[V], error)
ConvertResult transforms a Result[U] into a Result[V], using a transfomer function that converts a U to a V. Zero values of type U are converted to zero values of type V directly, without passing through the transformer function.
func (*Result[T]) AddAttestation ¶
func (r *Result[T]) AddAttestation(k string, v Attestation[T])
Click to show internal directories.
Click to hide internal directories.