Documentation ¶
Index ¶
Constants ¶
View Source
const ( FsMagicBtrfs = FsMagic(0x9123683E) FsMagicAufs = FsMagic(0x61756673) )
Variables ¶
Functions ¶
func MakePrivate ¶
Types ¶
type Driver ¶
type Driver interface { ProtoDriver // Diff produces an archive of the changes between the specified // layer and its parent layer which may be "". Diff(id, parent string) (archive.Archive, error) // Changes produces a list of changes between the specified layer // and its parent layer. If parent is "", then all changes will be ADD changes. Changes(id, parent string) ([]archive.Change, error) // ApplyDiff extracts the changeset from the given diff into the // layer with the specified id and parent, returning the size of the // new layer in bytes. ApplyDiff(id, parent string, diff archive.ArchiveReader) (bytes int64, err error) // DiffSize calculates the changes between the specified id // and its parent and returns the size in bytes of the changes // relative to its base filesystem directory. DiffSize(id, parent string) (bytes int64, err error) }
Driver is the interface for layered/snapshot file system drivers.
func NaiveDiffDriver ¶ added in v1.3.0
func NaiveDiffDriver(driver ProtoDriver) Driver
NaiveDiffDriver returns a fully functional driver that wraps the given ProtoDriver and adds the capability of the following methods which it may or may not support on its own:
Diff(id, parent string) (archive.Archive, error) Changes(id, parent string) ([]archive.Change, error) ApplyDiff(id, parent string, diff archive.ArchiveReader) (bytes int64, err error) DiffSize(id, parent string) (bytes int64, err error)
type ProtoDriver ¶ added in v1.3.0
type ProtoDriver interface { // String returns a string representation of this driver. String() string // Create creates a new, empty, filesystem layer with the // specified id and parent. Parent may be "". Create(id, parent string) error // Remove attempts to remove the filesystem layer with this id. Remove(id string) error // Get returns the mountpoint for the layered filesystem referred // to by this id. You can optionally specify a mountLabel or "". // Returns the absolute path to the mounted layered filesystem. Get(id, mountLabel string) (dir string, err error) // Put releases the system resources for the specified id, // e.g, unmounting layered filesystem. Put(id string) // Exists returns whether a filesystem layer with the specified // ID exists on this driver. Exists(id string) bool // Status returns a set of key-value pairs which give low // level diagnostic status about this driver. Status() [][2]string // Cleanup performs necessary tasks to release resources // held by the driver, e.g., unmounting all layered filesystems // known to this driver. Cleanup() error }
ProtoDriver defines the basic capabilities of a driver. This interface exists solely to be a minimum set of methods for client code which choose not to implement the entire Driver interface and use the NaiveDiffDriver wrapper constructor.
Use of ProtoDriver directly by client code is not recommended.
Click to show internal directories.
Click to hide internal directories.