Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fingerprint ¶
type Fingerprint struct {
hash.Fingerprint
}
Fingerprint represents the unique fingerprint value of a resource's data.
func NewFingerprint ¶
func NewFingerprint(f hash.Fingerprint) Fingerprint
NewFingerprint returns a resource store Fingerprint for the given hash Fingerprint.
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
ID is the ID of the stored blob in the database, this can be used for adding referential integrity from the resource to the stored blob. This can be an object store metadata UUID or a container image metadata storage key. It is only one, never both.
func NewContainerImageMetadataResourceID ¶
NewContainerImageMetadataResourceID creates a new storage ID for a container image metadata resource.
func NewFileResourceID ¶
func NewFileResourceID(uuid objectstore.UUID) (ID, error)
NewFileResourceID creates a new storage ID for a file resource.
func (ID) ContainerImageMetadataStoreID ¶
ContainerImageMetadataStoreID returns the container image metadata store ID or an error if it is not set.
func (ID) IsContainerImageMetadataID ¶
IsContainerImageMetadataID returns true if the type contains a container image metadata store ID.
func (ID) IsObjectStoreUUID ¶
IsObjectStoreUUID returns true if the type contains an object store UUID.
func (ID) ObjectStoreUUID ¶
func (id ID) ObjectStoreUUID() (objectstore.UUID, error)
ObjectStoreUUID returns the object store UUID or an error if it is not set.
type ResourceStore ¶
type ResourceStore interface { // Get returns an io.ReadCloser for a resource in the resource store. Get( ctx context.Context, storageKey string, ) (r io.ReadCloser, size int64, err error) // Put stores data from io.Reader in the resource store using the storage // key. Put( ctx context.Context, storageKey string, r io.Reader, size int64, fingerprint Fingerprint, ) (ID, error) // Remove removes a resource from storage. Remove( ctx context.Context, storageKey string, ) error }
ResourceStore provides a list of methods necessary for interacting with a store for the resource.
type ResourceStoreGetter ¶
type ResourceStoreGetter func() ResourceStore
ResourceStoreGetter is a function which returns a ResourceStore.