Documentation ¶
Index ¶
- Variables
- func Init(home string, options []string, idMap idtools.IdentityMapping) (graphdriver.Driver, error)
- func NaiveDiffDriverWithApply(driver ApplyDiffProtoDriver, idMap idtools.IdentityMapping) graphdriver.Driver
- type ApplyDiffProtoDriver
- type Driver
- func (d *Driver) ApplyDiff(id string, parent string, diff io.Reader) (size int64, err error)
- func (d *Driver) Cleanup() error
- func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error)
- func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error
- func (d *Driver) Exists(id string) bool
- func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, err 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) 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, idMap idtools.IdentityMapping) (graphdriver.Driver, error)
Init returns the NaiveDiffDriver, a native diff driver for overlay filesystem. If overlay filesystem is not supported on the host, the error graphdriver.ErrNotSupported is returned. If an overlay filesystem is not supported over an existing filesystem then error graphdriver.ErrIncompatibleFS is returned.
func NaiveDiffDriverWithApply ¶
func NaiveDiffDriverWithApply(driver ApplyDiffProtoDriver, idMap idtools.IdentityMapping) graphdriver.Driver
NaiveDiffDriverWithApply returns a NaiveDiff driver with custom ApplyDiff.
Types ¶
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 io.Reader) (size int64, err error) }
ApplyDiffProtoDriver wraps the ProtoDriver by extending the interface with ApplyDiff method.
type Driver ¶
type Driver struct {
// 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 an ErrApplyDiffFallback error.
func (*Driver) Cleanup ¶
Cleanup any state created by overlay which should be cleaned when daemon is being shutdown. For now, we just have to unmount the bind mounted we had created.
func (*Driver) Create ¶
func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error)
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) CreateReadWrite ¶ added in v1.12.0
func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error
CreateReadWrite creates a layer that is writable for use as a container file system.
func (*Driver) Get ¶
func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, err error)
Get creates and mounts the required file system for the given id and returns the mount path.
func (*Driver) GetMetadata ¶ added in v1.8.0
GetMetadata returns metadata about the overlay driver such as root, LowerDir, UpperDir, WorkDir and MergeDir used to store data.
func (*Driver) Put ¶
Put unmounts the mount path created for the give id. It also removes the 'merged' directory to force the kernel to unmount the overlay mount in other namespaces.