Documentation ¶
Index ¶
- Variables
- func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error)
- func NaiveDiffDriverWithApply(driver ApplyDiffProtoDriver, uidMaps, gidMaps []idtools.IDMap) graphdriver.Driver
- type ActiveMount
- type ApplyDiffProtoDriver
- type Driver
- func (d *Driver) ApplyDiff(id string, parent string, diff archive.Reader) (size int64, err error)
- func (d *Driver) Cleanup() error
- func (d *Driver) Create(id, parent, mountLabel string) (retErr error)
- func (d *Driver) Exists(id string) bool
- func (d *Driver) Get(id string, mountLabel string) (string, error)
- func (d *Driver) GetMetadata(id string) (map[string]string, error)
- func (d *Driver) Put(id string) error
- func (d *Driver) Remove(id string) error
- func (d *Driver) Setup() error
- func (d *Driver) Status() [][2]string
- func (d *Driver) String() string
Constants ¶
This section is empty.
Variables ¶
var ( // ErrApplyDiffFallback is returned to indicate that a normal ApplyDiff is applied as a fallback from Naive diff writer. ErrApplyDiffFallback = fmt.Errorf("Fall back to normal ApplyDiff") )
Functions ¶
func Init ¶
func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error)
Init returns the NaiveDiffDriver, a native diff driver for overlay filesystem. If overlay filesystem is not supported on the host, graphdriver.ErrNotSupported is returned as error. If a overlay filesystem is not supported over a existing filesystem then error graphdriver.ErrIncompatibleFS is returned.
func NaiveDiffDriverWithApply ¶
func NaiveDiffDriverWithApply(driver ApplyDiffProtoDriver, uidMaps, gidMaps []idtools.IDMap) graphdriver.Driver
NaiveDiffDriverWithApply returns a NaiveDiff driver with custom ApplyDiff.
Types ¶
type ActiveMount ¶
type ActiveMount struct {
// contains filtered or unexported fields
}
ActiveMount contains information about the count, path and whether is mounted or not. This information is part of the Driver, that contains list of active mounts that are part of this overlay.
type ApplyDiffProtoDriver ¶
type ApplyDiffProtoDriver interface { graphdriver.ProtoDriver // ApplyDiff writes the diff to the archive for the given id and parent id. // It returns the size in bytes written if successful, an error ErrApplyDiffFallback is returned otherwise. ApplyDiff(id, parent string, diff archive.Reader) (size int64, err error) }
ApplyDiffProtoDriver wraps the ProtoDriver by extending the inteface with ApplyDiff method.
type Driver ¶
type Driver struct { sync.Mutex // Protects concurrent modification to active // contains filtered or unexported fields }
Driver contains information about the home directory and the list of active mounts that are created using this driver.
func (*Driver) ApplyDiff ¶
ApplyDiff applies the new layer on top of the root, if parent does not exist with will return a ErrApplyDiffFallback error.
func (*Driver) Cleanup ¶
Cleanup simply returns nil and do not change the existing filesystem. This is required to satisfy the graphdriver.Driver interface.
func (*Driver) Create ¶
Create is used to create the upper, lower, and merge directories required for overlay fs for a given id. The parent filesystem is used to configure these directories for the overlay.
func (*Driver) Get ¶
Get creates and mounts the required file system for the given id and returns the mount path.
func (*Driver) GetMetadata ¶
GetMetadata returns meta data about the overlay driver such as root, LowerDir, UpperDir, WorkDir and MergeDir used to store data.