store

package
v0.7.1-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 31 Imported by: 2

Documentation

Overview

See https://github.com/containers/image/blob/master/docs/policy.json.md

Index

Constants

View Source
const (
	AnnotationImported       = "com.github.mgoltzsche.ctnr.image.imported"
	AnnotationParentManifest = "com.github.mgoltzsche.ctnr.image.parent.manifest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobStore

type BlobStore string

func NewBlobStore

func NewBlobStore(dir string) BlobStore

func (BlobStore) Delete

func (s BlobStore) Delete(key digest.Digest) (err error)

func (BlobStore) Exists

func (s BlobStore) Exists(key digest.Digest) (r bool, err error)

func (BlobStore) Get

func (s BlobStore) Get(key digest.Digest) (f io.ReadCloser, err error)

func (BlobStore) Keys

func (s BlobStore) Keys() (r []digest.Digest, err error)

func (BlobStore) Put

func (s BlobStore) Put(key digest.Digest, content io.Reader) (written int64, err error)

func (BlobStore) Retain

func (s BlobStore) Retain(keep map[digest.Digest]bool) (err error)

type CommitResult

type CommitResult struct {
	Manifest   ispecs.Manifest
	Config     ispecs.Image
	Descriptor ispecs.Descriptor
}

type ContentAddressableStore

type ContentAddressableStore struct {
	BlobStore
}

func NewContentAddressableStore

func NewContentAddressableStore(dir string) (r ContentAddressableStore)

func (*ContentAddressableStore) GetInfo

func (s *ContentAddressableStore) GetInfo(id digest.Digest) (st os.FileInfo, err error)

func (*ContentAddressableStore) Put

func (s *ContentAddressableStore) Put(reader io.Reader) (d digest.Digest, size int64, err error)

Writes a raw blob into the store using its digest as key

type FsSpecStore

type FsSpecStore struct {
	BlobStore
	// contains filtered or unexported fields
}

func NewFsSpecStore

func NewFsSpecStore(dir string, debug log.Logger) FsSpecStore

func (*FsSpecStore) Get

func (s *FsSpecStore) Get(fsId digest.Digest) (spec fs.FsNode, err error)

func (*FsSpecStore) Put

func (s *FsSpecStore) Put(fsId digest.Digest, spec fs.FsNode) (err error)

type ImageID

type ImageID struct {
	ID             digest.Digest
	ManifestDigest digest.Digest
}

func (ImageID) String

func (s ImageID) String() string

type ImageIdStore

type ImageIdStore struct {
	BlobStore
}

func NewImageIdStore

func NewImageIdStore(dir string) ImageIdStore

func (*ImageIdStore) Entries

func (s *ImageIdStore) Entries() (r []ImageID, err error)

func (*ImageIdStore) Get

func (s *ImageIdStore) Get(imageID digest.Digest) (r ImageID, err error)

func (*ImageIdStore) Put

func (s *ImageIdStore) Put(imageID, manifestDigest digest.Digest) (err error)

type ImageRepo

type ImageRepo struct {
	Name string
	// contains filtered or unexported fields
}

Read-only OCI image index representation

func NewImageRepo

func NewImageRepo(name, dir string) (r *ImageRepo, err error)

func (*ImageRepo) Manifest

func (s *ImageRepo) Manifest(ref string) (d ispecs.Descriptor, err error)

Returns the manifest descriptor matching the given ref or an error.

func (*ImageRepo) Manifests

func (s *ImageRepo) Manifests() (r []ispecs.Descriptor, err error)

Returns all valid contained manifest descriptors and an error if a descriptor has no ref

type ImageStore

type ImageStore struct {
	*ImageStoreRO
	// contains filtered or unexported fields
}

func NewImageStore

func NewImageStore(locker lock.ExclusiveLocker, store *ImageStoreRO, temp string, systemContext *types.SystemContext, trustPolicy TrustPolicyContext, rootless bool, loggers log.Loggers) *ImageStore

func (*ImageStore) DelImage

func (s *ImageStore) DelImage(ids ...digest.Digest) (err error)

func (*ImageStore) ImageGC

func (s *ImageStore) ImageGC(ttl, refTTL time.Duration, maxPerRepo int) (err error)

func (*ImageStore) OpenLockedImageStore

func (s *ImageStore) OpenLockedImageStore() (image.ImageStoreRW, error)

type ImageStoreRO

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

func NewImageStoreRO

func NewImageStoreRO(dir string, blobStore *OCIBlobStore, imageIds ImageIdStore, warn log.Logger) (r *ImageStoreRO)

func (*ImageStoreRO) Image

func (s *ImageStoreRO) Image(id digest.Digest) (r image.Image, err error)

func (*ImageStoreRO) ImageByName

func (s *ImageStoreRO) ImageByName(nameRef string) (r image.Image, err error)

func (*ImageStoreRO) ImageConfig

func (s *ImageStoreRO) ImageConfig(id digest.Digest) (ispecs.Image, error)

func (*ImageStoreRO) Images

func (s *ImageStoreRO) Images() (r []*image.ImageInfo, err error)

func (*ImageStoreRO) Repos

func (s *ImageStoreRO) Repos() (r []*ImageRepo, err error)

func (*ImageStoreRO) RetainRepo

func (s *ImageStoreRO) RetainRepo(repoName string, keep map[digest.Digest]bool, maxPerRepo int) (err error)

func (*ImageStoreRO) UnpackImageLayers

func (s *ImageStoreRO) UnpackImageLayers(imageId digest.Digest, rootfs string) (err error)

type ImageStoreRW

type ImageStoreRW struct {
	*ImageStoreRO
	// contains filtered or unexported fields
}

func NewImageStoreRW

func NewImageStoreRW(locker lock.Locker, roStore *ImageStoreRO, tmpDir string, systemContext *types.SystemContext, trustPolicy TrustPolicyContext, rootless bool, loggers log.Loggers) (r *ImageStoreRW, err error)

func (*ImageStoreRW) AddImageConfig

func (s *ImageStoreRW) AddImageConfig(conf ispecs.Image, parentImageId *digest.Digest) (img image.Image, err error)

func (*ImageStoreRW) AddLayer

func (s *ImageStoreRW) AddLayer(rootfs fs.FsNode, parentImageId *digest.Digest, author, createdByOp string) (img image.Image, err error)

func (*ImageStoreRW) Close

func (s *ImageStoreRW) Close() (err error)

func (*ImageStoreRW) FS

func (s *ImageStoreRW) FS(imageId digest.Digest) (r fs.FsNode, err error)

Returns the image's fs spec (files not extractable)

func (*ImageStoreRW) ImportImage

func (s *ImageStoreRW) ImportImage(src string) (img image.Image, err error)

func (*ImageStoreRW) SupportsTransport

func (s *ImageStoreRW) SupportsTransport(transportName string) bool

func (*ImageStoreRW) TagImage

func (s *ImageStoreRW) TagImage(imageId digest.Digest, tagStr string) (img image.ImageInfo, err error)

Creates a new image ref. Overwrites existing refs.

func (*ImageStoreRW) UntagImage

func (s *ImageStoreRW) UntagImage(tagStr string) (err error)

type LockedImageRepo

type LockedImageRepo struct {
	*ImageRepo
	// contains filtered or unexported fields
}

Writeable OCI image index representation

func NewLockedImageRepo

func NewLockedImageRepo(name, dir, extBlobDir string) (r *LockedImageRepo, err error)

func (*LockedImageRepo) AddManifest

func (r *LockedImageRepo) AddManifest(descriptor ispecs.Descriptor)

Adds a manifest descriptor

func (*LockedImageRepo) Close

func (r *LockedImageRepo) Close() (err error)

Writes the image index to disk and releases the lock

func (*LockedImageRepo) DelManifest

func (r *LockedImageRepo) DelManifest(ref string)

func (*LockedImageRepo) Limit

func (s *LockedImageRepo) Limit(maxPerRepo int)

func (*LockedImageRepo) Retain

func (s *LockedImageRepo) Retain(keepManifests map[digest.Digest]bool)

type OCIBlobStore

type OCIBlobStore struct {
	*ContentAddressableStore
	// contains filtered or unexported fields
}

func NewOCIBlobStore

func NewOCIBlobStore(blobStore *ContentAddressableStore, fsSpecStore *FsSpecStore, rootless bool, warn log.Logger, debug log.Logger) OCIBlobStore

func (*OCIBlobStore) AddLayer

func (s *OCIBlobStore) AddLayer(rootfs fs.FsNode, parentManifestDigest *digest.Digest, author, createdBy string) (r *CommitResult, err error)

Creates a new image with a layer containing the provided file system's difference to the parent provided image.

func (*OCIBlobStore) FS

func (s *OCIBlobStore) FS(manifestDigest digest.Digest) (r fs.FsNode, err error)

func (*OCIBlobStore) FSSpec

func (s *OCIBlobStore) FSSpec(manifestDigest digest.Digest) (r fs.FsNode, err error)

func (*OCIBlobStore) ImageConfig

func (s *OCIBlobStore) ImageConfig(configDigest digest.Digest) (r ispecs.Image, err error)

func (*OCIBlobStore) ImageManifest

func (s *OCIBlobStore) ImageManifest(manifestDigest digest.Digest) (r ispecs.Manifest, err error)

func (*OCIBlobStore) PutImageConfig

func (s *OCIBlobStore) PutImageConfig(cfg ispecs.Image, parentManifestId *digest.Digest) (d ispecs.Descriptor, manifest ispecs.Manifest, err error)

func (*OCIBlobStore) UnpackLayers

func (s *OCIBlobStore) UnpackLayers(manifestDigest digest.Digest, dest string) (err error)

Unpacks all layers contained in the referenced manifest into rootfs

type TrustPolicyContext

type TrustPolicyContext interface {
	Policy() (*signature.PolicyContext, error)
}

func TrustPolicyDefault

func TrustPolicyDefault(ctx *types.SystemContext) TrustPolicyContext

func TrustPolicyFromFile

func TrustPolicyFromFile(file string) TrustPolicyContext

func TrustPolicyInsecure

func TrustPolicyInsecure() TrustPolicyContext

func TrustPolicyReject

func TrustPolicyReject() TrustPolicyContext

Jump to

Keyboard shortcuts

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