package result

import "github.com/moby/buildkit/solver/result"

Index

Functions

func EachRef

func EachRef[U any, V any](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

func FromDigestMap

func FromDigestMap(m map[string]string) []digest.Digest

func ToDigestMap

func ToDigestMap(ds ...digest.Digest) map[string]string

Types

type Attestation

type Attestation struct {
	Kind pb.AttestationKind

	Ref         string
	Path        string
	ContentFunc func() ([]byte, error)

	InToto InTotoAttestation
}

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 any] struct {
	Ref          T
	Refs         map[string]T
	Metadata     map[string][]byte
	Attestations map[string][]Attestation
	// contains filtered or unexported fields
}

func ConvertResult

func ConvertResult[U any, V any](r *Result[U], fn func(U) (V, error)) (*Result[V], error)

func (*Result[T]) AddAttestation

func (r *Result[T]) AddAttestation(k string, v Attestation, ref T)

func (*Result[T]) AddMeta

func (r *Result[T]) AddMeta(k string, v []byte)

func (*Result[T]) AddRef

func (r *Result[T]) AddRef(k string, ref T)

func (*Result[T]) EachRef

func (r *Result[T]) EachRef(fn func(T) error) (err error)

func (*Result[T]) SetRef

func (r *Result[T]) SetRef(ref T)

func (*Result[T]) SingleRef

func (r *Result[T]) SingleRef() (T, error)

Source Files

attestation.go result.go

Version
v0.11.0-rc1
Published
Nov 24, 2022
Platform
js/wasm
Imports
7 packages
Last checked
2 minutes ago

Tools for package owners.