overlay

package
v1.11.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 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 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

func (d *Driver) ApplyDiff(id string, parent string, diff archive.Reader) (size int64, err error)

ApplyDiff applies the new layer on top of the root, if parent does not exist with will return a ErrApplyDiffFallback error.

func (*Driver) Cleanup

func (d *Driver) Cleanup() error

Cleanup simply returns nil and do not change the existing filesystem. This is required to satisfy the graphdriver.Driver interface.

func (*Driver) Create

func (d *Driver) Create(id, parent, mountLabel string) (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) Exists

func (d *Driver) Exists(id string) bool

Exists checks to see if the id is already mounted.

func (*Driver) Get

func (d *Driver) Get(id string, mountLabel string) (string, 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

func (d *Driver) GetMetadata(id string) (map[string]string, error)

GetMetadata returns meta data about the overlay driver such as root, LowerDir, UpperDir, WorkDir and MergeDir used to store data.

func (*Driver) Put

func (d *Driver) Put(id string) error

Put unmounts the mount path created for the give id.

func (*Driver) Remove

func (d *Driver) Remove(id string) error

Remove cleans the directories that are created for this id.

func (*Driver) Status

func (d *Driver) Status() [][2]string

Status returns current driver information in a two dimensional string array. Output contains "Backing Filesystem" used in this implementation.

func (*Driver) String

func (d *Driver) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL