appender

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package appender provides an API to push layers, report progress while pushing and return a resulting image+hash

Index

Constants

This section is empty.

Variables

View Source
var AppendResultNone = AppendResult{
	Hash:                v1.Hash{},
	Pushed:              mutate.IndexAddendum{},
	AddedManifestLayers: []AppendResultLayer{},
}

Functions

This section is empty.

Types

type AppendAnnotate

type AppendAnnotate func(partial.WithRawManifest) v1.Image

type AppendResult

type AppendResult struct {
	// Hash is the digest of the pushed manifest, including annotate
	Hash v1.Hash
	// Pushed is how this result can be added to an index manifest
	Pushed mutate.IndexAddendum
	// AddedManifestLayers are manifest data for appended and pushed layers
	AddedManifestLayers []AppendResultLayer
}

type AppendResultLayer

type AppendResultLayer struct {
	MediaType types.MediaType `json:"mediaType"`
	Size      int64           `json:"size"`
	Digest    v1.Hash         `json:"digest"`
}

AppendResultLayer is required part of go-containerregistry v1.Descriptor and sufficient to define a layer appended to a manifest

func (*AppendResultLayer) Descriptor

func (l *AppendResultLayer) Descriptor() v1.Descriptor

type Appender

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

Appender transfers layers AND pushes manifest and is reasonably efficient should multiple appenders push the same layers

func New

func New(baseRef name.Digest, baseConfig *registry.RegistryConfig, tagRef name.Reference) (*Appender, error)

New starts Appender setup from a fully specified base ref which might be an image in an index, not necessarily Contain's base. This base image has typically not been read yet, not even its manifest. Remember to optionally call WithAnnotate before Append.

func (*Appender) Append

func (c *Appender) Append(layers ...v1.Layer) (AppendResult, error)

Append is what you call once layers are ready

func (*Appender) WithAnnotate

func (c *Appender) WithAnnotate(annotate annotate.Annotator)

type Chdir

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

func NewChdir

func NewChdir(dir string) *Chdir

NewChdir changes current working directory to the path given by the dir arg

func (*Chdir) Cleanup

func (c *Chdir) Cleanup()

cleanup restores working directory based on the result of NewChdir

Jump to

Keyboard shortcuts

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