Help us shape the future of Go! Take the 2026 Go Developer Survey

materials

package
v0.8.93 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidMaterialType = fmt.Errorf("unexpected material type")

ErrInvalidMaterialType is returned when the provided material type is not from the kind we are expecting

Functions

func Craft

func Craft(ctx context.Context, materialSchema *schemaapi.CraftingSchema_Material, value string, uploader Uploader, logger *zerolog.Logger) (*api.Attestation_Material, error)

Types

type ArtifactCrafter

type ArtifactCrafter struct {
	// contains filtered or unexported fields
}

func NewArtifactCrafter

func NewArtifactCrafter(schema *schemaapi.CraftingSchema_Material, uploader Uploader, l *zerolog.Logger) (*ArtifactCrafter, error)

func (*ArtifactCrafter) Craft

func (i *ArtifactCrafter) Craft(ctx context.Context, artifactPath string) (*api.Attestation_Material, error)

Craft will calculate the digest of the artifact, simulate an upload and return the material definition

type Craftable

type Craftable interface {
	Craft(ctx context.Context, value string) (*api.Attestation_Material, error)
}

type CyclonedxJSONCrafter

type CyclonedxJSONCrafter struct {
	// contains filtered or unexported fields
}

func NewCyclonedxJSONCrafter

func NewCyclonedxJSONCrafter(materialSchema *schemaapi.CraftingSchema_Material, uploader Uploader, l *zerolog.Logger) (*CyclonedxJSONCrafter, error)

func (*CyclonedxJSONCrafter) Craft

type Downloader

type Downloader interface {
	Download(ctx context.Context, w io.Writer, digest string) error
	Describe(ctx context.Context, digest string) (*ResourceInfo, error)
}

type OCIImageCrafter

type OCIImageCrafter struct {
	// contains filtered or unexported fields
}

func (*OCIImageCrafter) Craft

func (i *OCIImageCrafter) Craft(ctx context.Context, imageRef string) (*api.Attestation_Material, error)

type ResourceInfo

type ResourceInfo struct {
	Digest   string
	Filename string
	Size     int64
}

type SPDXJSONCrafter

type SPDXJSONCrafter struct {
	// contains filtered or unexported fields
}

func NewSPDXJSONCrafter

func NewSPDXJSONCrafter(materialSchema *schemaapi.CraftingSchema_Material, uploader Uploader, l *zerolog.Logger) (*SPDXJSONCrafter, error)

func (*SPDXJSONCrafter) Craft

func (i *SPDXJSONCrafter) Craft(ctx context.Context, filePath string) (*api.Attestation_Material, error)

type StringCrafter

type StringCrafter struct {
	// contains filtered or unexported fields
}

func NewStringCrafter

func NewStringCrafter(materialSchema *schemaapi.CraftingSchema_Material) (*StringCrafter, error)

func (*StringCrafter) Craft

type UpDownStatus

type UpDownStatus struct {
	Filepath, Filename, Digest     string
	TotalSizeBytes, ProcessedBytes int64
}

type Uploader

type Uploader interface {
	Upload(ctx context.Context, filePath string) (*UpDownStatus, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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