handler

package
v0.6.4-214-ged92cff Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

Index

Constants

View Source
const (
	ContainerdGCLayerPrefix   = "containerd.io/gc.ref.content.l"
	ContainerdGCContentPrefix = "containerd.io/gc.ref.content"
)
View Source
const (
	DirectoryHandlerManifestsDir = "manifests"
	DirectoryHandlerConfigsDir   = "configs"
	DirectoryHandlerLayersDir    = "layers"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerdHandler

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

func NewContainerdHandler

func NewContainerdHandler(ctx context.Context, address, namespace string, opts ...containerd.ClientOpt) (context.Context, *ContainerdHandler, error)

NewContainerdHandler creates a Resolver-compatible interface given the containerd address and namespace.

func NewContainerdWithClient

func NewContainerdWithClient(ctx context.Context, client *containerd.Client) (context.Context, *ContainerdHandler, error)

NewContainerdWithClient create a containerd Resolver-compatible with an existing containerd client connection.

func (*ContainerdHandler) DigestExists

func (handle *ContainerdHandler) DigestExists(ctx context.Context, dgst digest.Digest) (exists bool, err error)

DigestExists implements DigestResolver.

func (*ContainerdHandler) FetchImage

func (handle *ContainerdHandler) FetchImage(ctx context.Context, name, plat string, onProgress func(float64)) (err error)

FetchImage implements ImageFetcher.

func (*ContainerdHandler) FinalizeImage

func (handle *ContainerdHandler) FinalizeImage(ctx context.Context, image ocispec.Image) error

FinalizeImage implements ImageFinalizer.

func (*ContainerdHandler) ListManifests

func (handle *ContainerdHandler) ListManifests(ctx context.Context) (manifests []ocispec.Manifest, err error)

ListManifests implements DigestResolver.

func (*ContainerdHandler) PushImage

func (handle *ContainerdHandler) PushImage(ctx context.Context, ref string, target *ocispec.Descriptor) error

PushImage implements ImagePusher.

func (*ContainerdHandler) ResolveImage

func (handle *ContainerdHandler) ResolveImage(ctx context.Context, fullref string) (imgspec ocispec.Image, err error)

ResolveImage implements ImageResolver.

func (*ContainerdHandler) SaveDigest added in v0.6.5

func (handle *ContainerdHandler) SaveDigest(ctx context.Context, ref string, desc ocispec.Descriptor, reader io.Reader, onProgress func(float64)) (err error)

SaveDigest implements DigestSaver.

func (*ContainerdHandler) UnpackImage

func (handle *ContainerdHandler) UnpackImage(ctx context.Context, ref string, dest string) (err error)

UnpackImage implements ImageUnpacker.

type DescriptorResolver

type DescriptorResolver interface {
	ResolveDescriptor(context.Context, string) (ocispec.Descriptor, error)
}

type DigestResolver

type DigestResolver interface {
	DigestExists(context.Context, digest.Digest) (bool, error)
}

type DigestSaver added in v0.6.5

type DigestSaver interface {
	SaveDigest(context.Context, string, ocispec.Descriptor, io.Reader, func(float64)) error
}

type DirectoryHandler added in v0.6.4

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

func NewDirectoryHandler added in v0.6.4

func NewDirectoryHandler(path string) (*DirectoryHandler, error)

func (*DirectoryHandler) DigestExists added in v0.6.4

func (handle *DirectoryHandler) DigestExists(ctx context.Context, dgst digest.Digest) (exists bool, err error)

DigestExists implements DigestResolver.

func (*DirectoryHandler) FetchImage added in v0.6.4

func (handle *DirectoryHandler) FetchImage(ctx context.Context, fullref, platform string, onProgress func(float64)) (err error)

FetchImage implements ImageFetcher.

func (*DirectoryHandler) FinalizeImage added in v0.6.4

func (handle *DirectoryHandler) FinalizeImage(ctx context.Context, image ocispec.Image) error

FinalizeImage implements ImageFinalizer.

func (*DirectoryHandler) ListManifests added in v0.6.4

func (handle *DirectoryHandler) ListManifests(ctx context.Context) (manifests []ocispec.Manifest, err error)

ListManifests implements DigestResolver.

func (*DirectoryHandler) PushImage added in v0.6.4

func (handle *DirectoryHandler) PushImage(ctx context.Context, fullref string, target *ocispec.Descriptor) error

PushImage implements ImagePusher.

func (*DirectoryHandler) ResolveImage added in v0.6.4

func (handle *DirectoryHandler) ResolveImage(ctx context.Context, fullref string) (imgspec ocispec.Image, err error)

ResolveImage implements ImageResolver.

func (*DirectoryHandler) SaveDigest added in v0.6.5

func (handle *DirectoryHandler) SaveDigest(ctx context.Context, ref string, desc ocispec.Descriptor, reader io.Reader, onProgress func(float64)) error

SaveDigest implements DigestSaver.

func (*DirectoryHandler) UnpackImage added in v0.6.4

func (handle *DirectoryHandler) UnpackImage(ctx context.Context, ref string, dest string) (err error)

UnpackImage implements ImageUnpacker.

type DirectoryImage added in v0.6.5

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

func (DirectoryImage) ConfigFile added in v0.6.5

func (di DirectoryImage) ConfigFile() (*v1.ConfigFile, error)

ConfigFile returns the structured config file of the image

func (DirectoryImage) ConfigName added in v0.6.5

func (di DirectoryImage) ConfigName() (v1.Hash, error)

ConfigName returns the hash of the image config

func (DirectoryImage) Digest added in v0.6.5

func (di DirectoryImage) Digest() (v1.Hash, error)

Digest returns the hash of the image manifest

func (DirectoryImage) LayerByDiffID added in v0.6.5

func (di DirectoryImage) LayerByDiffID(hash v1.Hash) (v1.Layer, error)

LayerByDiffID returns the layer with the given hash Unused by push

func (DirectoryImage) LayerByDigest added in v0.6.5

func (di DirectoryImage) LayerByDigest(hash v1.Hash) (v1.Layer, error)

LayerByDigest returns the layer with the given hash Unused by push

func (DirectoryImage) Layers added in v0.6.5

func (di DirectoryImage) Layers() ([]v1.Layer, error)

Layers returns the layers of the image

func (DirectoryImage) Manifest added in v0.6.5

func (di DirectoryImage) Manifest() (*v1.Manifest, error)

Manifest returns the structured manifest of the image

func (DirectoryImage) MediaType added in v0.6.5

func (di DirectoryImage) MediaType() (types.MediaType, error)

MediaType returns the mediatype of the image

func (DirectoryImage) RawConfigFile added in v0.6.5

func (di DirectoryImage) RawConfigFile() ([]byte, error)

RawConfigFile returns the config file of the image in bytes It reads the config file from the filesystem

func (DirectoryImage) RawManifest added in v0.6.5

func (di DirectoryImage) RawManifest() ([]byte, error)

RawManifest returns the manifest of the image in bytes It reads the manifest from the filesystem

func (DirectoryImage) Size added in v0.6.5

func (di DirectoryImage) Size() (int64, error)

Size returns the size of the image manifest

type DirectoryLayer added in v0.6.5

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

func (DirectoryLayer) Compressed added in v0.6.5

func (dl DirectoryLayer) Compressed() (io.ReadCloser, error)

Compressed returns the compressed layer as a ReadCloser It reads the layer from the filesystem

func (DirectoryLayer) DiffID added in v0.6.5

func (dl DirectoryLayer) DiffID() (v1.Hash, error)

DiffID returns the diffID of the layer as a Hash

func (DirectoryLayer) Digest added in v0.6.5

func (dl DirectoryLayer) Digest() (v1.Hash, error)

Digest returns the digest of the layer as a Hash

func (DirectoryLayer) MediaType added in v0.6.5

func (dl DirectoryLayer) MediaType() (types.MediaType, error)

MediaType returns the mediatype of the layer

func (DirectoryLayer) Size added in v0.6.5

func (dl DirectoryLayer) Size() (int64, error)

Size returns the size of the layer

func (DirectoryLayer) Uncompressed added in v0.6.5

func (dl DirectoryLayer) Uncompressed() (io.ReadCloser, error)

Uncompressed is not implemented

type ImageFetcher

type ImageFetcher interface {
	FetchImage(context.Context, string, string, func(float64)) error
}

type ImagePusher added in v0.6.0

type ImagePusher interface {
	PushImage(context.Context, string, *ocispec.Descriptor) error
}

type ImageResolver

type ImageResolver interface {
	ResolveImage(context.Context, string) (ocispec.Image, error)
}

type ImageUnpacker

type ImageUnpacker interface {
	UnpackImage(context.Context, string, string) error
}

type ManifestLister

type ManifestLister interface {
	ListManifests(context.Context) ([]ocispec.Manifest, error)
}

Jump to

Keyboard shortcuts

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