Documentation
¶
Index ¶
- type Seen
- type Storage
- func (t *Storage) CurrentImage() string
- func (t *Storage) DeleteBlob(name string) error
- func (t *Storage) Files() (map[string]os.FileInfo, error)
- func (t *Storage) Image(image string) error
- func (t *Storage) Images() ([]string, error)
- func (t *Storage) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error)
- func (t *Storage) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Seen ¶
type Seen struct {
// contains filtered or unexported fields
}
Seen is used to keep track of all blobs we have already seen across all stored images.
type Storage ¶
type Storage struct { types.ImageReference // contains filtered or unexported fields }
Storage handles the storage of multiple images. It is used to store multiple images in a single directory while deduplicating blobs.
func New ¶
New returns a reference to a Storage using provided directory as base (root). Property "seen" is used to we keep track of all blobs we have already seen across all stored images.
func (*Storage) CurrentImage ¶
CurrentImage returns the inner image we are operating on.
func (*Storage) DeleteBlob ¶
DeleteBlob deletes a blob from the current Storage. The file name must be a blob file name, i.e. a file name that is a valid digest.
func (*Storage) Files ¶
Files returns a list of all files stored in the Storage, includes files in all Images.
func (*Storage) Image ¶
Image sets the current inner Image inside the Storage. A Storage allows "write to" and "read from" on a single Image at a given time. Creates or uses an already existent subdirectory named after the Image name.
func (*Storage) Images ¶
Images list all images stored in the Storage. Traverses the Storage base directory and returns all subdirectories that do not contain a subdir or name starts with ".".
func (*Storage) NewImageDestination ¶
func (t *Storage) NewImageDestination( ctx context.Context, sys *types.SystemContext, ) (types.ImageDestination, error)
NewImageDestination returns a handler used to write to the current Image. Current image must be already set by the caller (using Image() function).
func (*Storage) NewImageSource ¶
func (t *Storage) NewImageSource( ctx context.Context, sys *types.SystemContext, ) (types.ImageSource, error)
NewImageSource returns a handler used to read from the Storage current Image. Current image must already be set by caller by means of a call to Image function.