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
- type ContainerdHandler
- func (handle *ContainerdHandler) DigestExists(ctx context.Context, dgst digest.Digest) (exists bool, err error)
- func (handle *ContainerdHandler) FetchImage(ctx context.Context, name, plat string, onProgress func(float64)) (err error)
- func (handle *ContainerdHandler) FinalizeImage(ctx context.Context, image ocispec.Image) error
- func (handle *ContainerdHandler) ListManifests(ctx context.Context) (manifests []ocispec.Manifest, err error)
- func (handle *ContainerdHandler) PushImage(ctx context.Context, ref string, target *ocispec.Descriptor) error
- func (handle *ContainerdHandler) ResolveImage(ctx context.Context, fullref string) (imgspec ocispec.Image, err error)
- func (handle *ContainerdHandler) SaveDigest(ctx context.Context, ref string, desc ocispec.Descriptor, reader io.Reader, ...) (err error)
- func (handle *ContainerdHandler) UnpackImage(ctx context.Context, ref string, dest string) (err error)
- type DescriptorResolver
- type DigestResolver
- type DigestSaver
- type DirectoryHandler
- func (handle *DirectoryHandler) DigestExists(ctx context.Context, dgst digest.Digest) (exists bool, err error)
- func (handle *DirectoryHandler) FetchImage(ctx context.Context, fullref, platform string, onProgress func(float64)) (err error)
- func (handle *DirectoryHandler) FinalizeImage(ctx context.Context, image ocispec.Image) error
- func (handle *DirectoryHandler) ListManifests(ctx context.Context) (manifests []ocispec.Manifest, err error)
- func (handle *DirectoryHandler) PushImage(ctx context.Context, fullref string, target *ocispec.Descriptor) error
- func (handle *DirectoryHandler) ResolveImage(ctx context.Context, fullref string) (imgspec ocispec.Image, err error)
- func (handle *DirectoryHandler) SaveDigest(ctx context.Context, ref string, desc ocispec.Descriptor, reader io.Reader, ...) error
- func (handle *DirectoryHandler) UnpackImage(ctx context.Context, ref string, dest string) (err error)
- type DirectoryImage
- func (di DirectoryImage) ConfigFile() (*v1.ConfigFile, error)
- func (di DirectoryImage) ConfigName() (v1.Hash, error)
- func (di DirectoryImage) Digest() (v1.Hash, error)
- func (di DirectoryImage) LayerByDiffID(hash v1.Hash) (v1.Layer, error)
- func (di DirectoryImage) LayerByDigest(hash v1.Hash) (v1.Layer, error)
- func (di DirectoryImage) Layers() ([]v1.Layer, error)
- func (di DirectoryImage) Manifest() (*v1.Manifest, error)
- func (di DirectoryImage) MediaType() (types.MediaType, error)
- func (di DirectoryImage) RawConfigFile() ([]byte, error)
- func (di DirectoryImage) RawManifest() ([]byte, error)
- func (di DirectoryImage) Size() (int64, error)
- type DirectoryLayer
- func (dl DirectoryLayer) Compressed() (io.ReadCloser, error)
- func (dl DirectoryLayer) DiffID() (v1.Hash, error)
- func (dl DirectoryLayer) Digest() (v1.Hash, error)
- func (dl DirectoryLayer) MediaType() (types.MediaType, error)
- func (dl DirectoryLayer) Size() (int64, error)
- func (dl DirectoryLayer) Uncompressed() (io.ReadCloser, error)
- type Handler
- type ImageFetcher
- type ImagePusher
- type ImageResolver
- type ImageUnpacker
- type ManifestLister
Constants ¶
const ( ContainerdGCLayerPrefix = "containerd.io/gc.ref.content.l" ContainerdGCContentPrefix = "containerd.io/gc.ref.content" )
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 ¶
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 DigestResolver ¶
type DigestSaver ¶ added in v0.6.5
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
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
LayerByDiffID returns the layer with the given hash Unused by push
func (DirectoryImage) LayerByDigest ¶ added in v0.6.5
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 Handler ¶
type Handler interface { DigestResolver DigestSaver ManifestLister ImagePusher ImageResolver ImageFetcher ImageUnpacker }