crate

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareImage

func PrepareImage(store StoreSetter, image *Image) ([]byte, *ocispec.Descriptor, error)

PrepareImage is used to assemble the OCI image according to given specification.

func Pull

func Pull(ctx context.Context, from target.Target, imageRef string, to target.Target) (*ocispec.Descriptor, error)

Pull the given image descriptor from the given repository.

func Push

func Push(ctx context.Context, registry target.Target, imageRef string, i *Image) (*ocispec.Descriptor, error)

Push the given image descriptor in the given repository.

Types

type DescriptorStore

type DescriptorStore struct {
	*content.Memory
}

func NewDescriptorStore

func NewDescriptorStore() *DescriptorStore

type Image

type Image struct {
	Config           schema.Config
	Containers       []*SealedContainer
	TemplateArchives []*TemplateArchive
}

func Build

func Build(rootFs fs.FS, spec *cratefile.Config) (*Image, error)

Build a crate from the given specification.

func ExtractImage

func ExtractImage(store StoreGetter) (*Image, error)

ExtractImage extracts from the given OCI storage the crate image descriptor.

type SealedContainer

type SealedContainer struct {
	Name      string                 `json:"name"`
	Container *containerv1.Container `json:"container"`
}

type StoreGetter

type StoreGetter interface {
	GetByName(name string) (ocispec.Descriptor, []byte, bool)
}

StoreGetter is the interface used to mock the image store.

type StoreSetter

type StoreSetter interface {
	Set(ocispec.Descriptor, []byte)
}

StoreSetter is the interface used to mock the image store.

type TemplateArchive

type TemplateArchive struct {
	Name    string `json:"name"`
	Archive []byte `json:"archive"`
}

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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