package metadata
import "github.com/docker/docker/distribution/metadata"
Index ¶
- type FSMetadataStore
- func NewFSMetadataStore(basePath string) (*FSMetadataStore, error)
- func (store *FSMetadataStore) Delete(namespace, key string) error
- func (store *FSMetadataStore) Get(namespace string, key string) ([]byte, error)
- func (store *FSMetadataStore) Set(namespace, key string, value []byte) error
- type Store
- type V1IDService
- func NewV1IDService(store Store) *V1IDService
- func (idserv *V1IDService) Get(v1ID, registry string) (layer.DiffID, error)
- func (idserv *V1IDService) Set(v1ID, registry string, id layer.DiffID) error
- type V2Metadata
- type V2MetadataService
- func NewV2MetadataService(store Store) *V2MetadataService
- func (serv *V2MetadataService) Add(diffID layer.DiffID, metadata V2Metadata) error
- func (serv *V2MetadataService) GetDiffID(dgst digest.Digest) (layer.DiffID, error)
- func (serv *V2MetadataService) GetMetadata(diffID layer.DiffID) ([]V2Metadata, error)
- func (serv *V2MetadataService) Remove(metadata V2Metadata) error
Types ¶
type FSMetadataStore ¶
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) Delete ¶
func (store *FSMetadataStore) Delete(namespace, key string) error
Delete removes data indexed by namespace and key. The data file named after the key, stored in the namespace's directory is deleted.
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 // Delete removes data indexed by namespace and key. Delete(namespace, key string) 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.
type V2Metadata ¶
V2Metadata contains the digest and source repository information for a layer.
type V2MetadataService ¶
type V2MetadataService struct {
// contains filtered or unexported fields
}
V2MetadataService maps layer IDs to a set of known metadata for the layer.
func NewV2MetadataService ¶
func NewV2MetadataService(store Store) *V2MetadataService
NewV2MetadataService creates a new diff ID to v2 metadata mapping service.
func (*V2MetadataService) Add ¶
func (serv *V2MetadataService) Add(diffID layer.DiffID, metadata V2Metadata) error
Add associates metadata with a layer DiffID. If too many metadata entries are present, the oldest one is dropped.
func (*V2MetadataService) GetDiffID ¶
GetDiffID finds a layer DiffID from a digest.
func (*V2MetadataService) GetMetadata ¶
func (serv *V2MetadataService) GetMetadata(diffID layer.DiffID) ([]V2Metadata, error)
GetMetadata finds the metadata associated with a layer DiffID.
func (*V2MetadataService) Remove ¶
func (serv *V2MetadataService) Remove(metadata V2Metadata) error
Remove unassociates a metadata entry from a layer DiffID.
Source Files ¶
metadata.go v1_id_service.go v2_metadata_service.go
- Version
- v1.12.0-rc4
- Published
- Jul 13, 2016
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 1 hour ago –
Tools for package owners.