metadata

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2016 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobSumService

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

BlobSumService maps layer IDs to a set of known blobsums for the layer.

func NewBlobSumService

func NewBlobSumService(store Store) *BlobSumService

NewBlobSumService creates a new blobsum mapping service.

func (*BlobSumService) Add

func (blobserv *BlobSumService) Add(diffID layer.DiffID, blobsum digest.Digest) error

Add associates a blobsum with a layer DiffID. If too many blobsums are present, the oldest one is dropped.

func (*BlobSumService) GetBlobSums

func (blobserv *BlobSumService) GetBlobSums(diffID layer.DiffID) ([]digest.Digest, error)

GetBlobSums finds the blobsums associated with a layer DiffID.

func (*BlobSumService) GetDiffID

func (blobserv *BlobSumService) GetDiffID(blobsum digest.Digest) (layer.DiffID, error)

GetDiffID finds a layer DiffID from a blobsum hash.

type FSMetadataStore

type FSMetadataStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

FSMetadataStore uses the filesystem to associate metadata with layer and image IDs.

func NewFSMetadataStore

func NewFSMetadataStore(basePath string) (*FSMetadataStore, error)

NewFSMetadataStore creates a new filesystem-based metadata store.

func (*FSMetadataStore) Get

func (store *FSMetadataStore) Get(namespace string, key string) ([]byte, error)

Get retrieves data by namespace and key. The data is read from a file named after the key, stored in the namespace's directory.

func (*FSMetadataStore) Set

func (store *FSMetadataStore) Set(namespace, key string, value []byte) error

Set writes data indexed by namespace and key. The data is written to a file named after the key, stored in the namespace's directory.

type Store

type Store interface {
	// Get retrieves data by namespace and key.
	Get(namespace string, key string) ([]byte, error)
	// Set writes data indexed by namespace and key.
	Set(namespace, key string, value []byte) error
}

Store implements a K/V store for mapping distribution-related IDs to on-disk layer IDs and image IDs. The namespace identifies the type of mapping (i.e. "v1ids" or "artifacts"). MetadataStore is goroutine-safe.

type V1IDService

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

V1IDService maps v1 IDs to layers on disk.

func NewV1IDService

func NewV1IDService(store Store) *V1IDService

NewV1IDService creates a new V1 ID mapping service.

func (*V1IDService) Get

func (idserv *V1IDService) Get(v1ID, registry string) (layer.DiffID, error)

Get finds a layer by its V1 ID.

func (*V1IDService) Set

func (idserv *V1IDService) Set(v1ID, registry string, id layer.DiffID) error

Set associates an image with a V1 ID.

Jump to

Keyboard shortcuts

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