{"modulePath":"github.com/hyperhq/hypercli","version":"v1.10.16","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package graphdriver\n\n## Constants\n\n```go\nconst (\n\t// FsMagicAufs filesystem id for Aufs\n\tFsMagicAufs = FsMagic(0x61756673)\n\t// FsMagicBtrfs filesystem id for Btrfs\n\tFsMagicBtrfs = FsMagic(0x9123683E)\n\t// FsMagicCramfs filesystem id for Cramfs\n\tFsMagicCramfs = FsMagic(0x28cd3d45)\n\t// FsMagicExtfs filesystem id for Extfs\n\tFsMagicExtfs = FsMagic(0x0000EF53)\n\t// FsMagicF2fs filesystem id for F2fs\n\tFsMagicF2fs = FsMagic(0xF2F52010)\n\t// FsMagicGPFS filesystem id for GPFS\n\tFsMagicGPFS = FsMagic(0x47504653)\n\t// FsMagicJffs2Fs filesystem if for Jffs2Fs\n\tFsMagicJffs2Fs = FsMagic(0x000072b6)\n\t// FsMagicJfs filesystem id for Jfs\n\tFsMagicJfs = FsMagic(0x3153464a)\n\t// FsMagicNfsFs filesystem id for NfsFs\n\tFsMagicNfsFs = FsMagic(0x00006969)\n\t// FsMagicRAMFs filesystem id for RamFs\n\tFsMagicRAMFs = FsMagic(0x858458f6)\n\t// FsMagicReiserFs filesystem id for ReiserFs\n\tFsMagicReiserFs = FsMagic(0x52654973)\n\t// FsMagicSmbFs filesystem id for SmbFs\n\tFsMagicSmbFs = FsMagic(0x0000517B)\n\t// FsMagicSquashFs filesystem id for SquashFs\n\tFsMagicSquashFs = FsMagic(0x73717368)\n\t// FsMagicTmpFs filesystem id for TmpFs\n\tFsMagicTmpFs = FsMagic(0x01021994)\n\t// FsMagicVxFS filesystem id for VxFs\n\tFsMagicVxFS = FsMagic(0xa501fcf5)\n\t// FsMagicXfs filesystem id for Xfs\n\tFsMagicXfs = FsMagic(0x58465342)\n\t// FsMagicZfs filesystem id for Zfs\n\tFsMagicZfs = FsMagic(0x2fc12fc1)\n)\n```\n\n```go\nconst (\n\t// FsMagicUnsupported is a predefined constant value other than a valid filesystem id.\n\tFsMagicUnsupported = FsMagic(0x00000000)\n)\n```\n\n## Variables\n\n```go\nvar (\n\n\t// ErrNotSupported returned when driver is not supported.\n\tErrNotSupported = errors.New(\"driver not supported\")\n\t// ErrPrerequisites retuned when driver does not meet prerequisites.\n\tErrPrerequisites = errors.New(\"prerequisites for driver not satisfied (wrong filesystem?)\")\n\t// ErrIncompatibleFS returned when file system is not supported.\n\tErrIncompatibleFS = fmt.Errorf(\"backing file system is unsupported for this graph driver\")\n)\n```\n\n```go\nvar (\n\t// ApplyUncompressedLayer defines the unpack method used by the graph\n\t// driver.\n\tApplyUncompressedLayer = chrootarchive.ApplyUncompressedLayer\n)\n```\n\n```go\nvar (\n\n\t// FsNames maps filesystem id to name of the filesystem.\n\tFsNames = map[FsMagic]string{\n\t\tFsMagicAufs:        \"aufs\",\n\t\tFsMagicBtrfs:       \"btrfs\",\n\t\tFsMagicCramfs:      \"cramfs\",\n\t\tFsMagicExtfs:       \"extfs\",\n\t\tFsMagicF2fs:        \"f2fs\",\n\t\tFsMagicGPFS:        \"gpfs\",\n\t\tFsMagicJffs2Fs:     \"jffs2\",\n\t\tFsMagicJfs:         \"jfs\",\n\t\tFsMagicNfsFs:       \"nfs\",\n\t\tFsMagicRAMFs:       \"ramfs\",\n\t\tFsMagicReiserFs:    \"reiserfs\",\n\t\tFsMagicSmbFs:       \"smb\",\n\t\tFsMagicSquashFs:    \"squashfs\",\n\t\tFsMagicTmpFs:       \"tmpfs\",\n\t\tFsMagicUnsupported: \"unsupported\",\n\t\tFsMagicVxFS:        \"vxfs\",\n\t\tFsMagicXfs:         \"xfs\",\n\t\tFsMagicZfs:         \"zfs\",\n\t}\n)\n```\n\n## Functions\n\n```go\nfunc Register(name string, initFunc InitFunc) error\n```\nRegister registers a InitFunc for the driver.\n\n## Types\n\n```go\ntype Driver interface {\n\tProtoDriver\n\t// Diff produces an archive of the changes between the specified\n\t// layer and its parent layer which may be \"\".\n\tDiff(id, parent string) (archive.Archive, error)\n\t// Changes produces a list of changes between the specified layer\n\t// and its parent layer. If parent is \"\", then all changes will be ADD changes.\n\tChanges(id, parent string) ([]archive.Change, error)\n\t// ApplyDiff extracts the changeset from the given diff into the\n\t// layer with the specified id and parent, returning the size of the\n\t// new layer in bytes.\n\t// The archive.Reader must be an uncompressed stream.\n\tApplyDiff(id, parent string, diff archive.Reader) (size int64, err error)\n\t// DiffSize calculates the changes between the specified id\n\t// and its parent and returns the size in bytes of the changes\n\t// relative to its base filesystem directory.\n\tDiffSize(id, parent string) (size int64, err error)\n}\n```\nDriver is the interface for layered/snapshot file system drivers.\n\n```go\nfunc GetDriver(name, home string, options []string, uidMaps, gidMaps []idtools.IDMap) (Driver, error)\n```\nGetDriver initializes and returns the registered driver\n\n```go\nfunc New(root string, name string, options []string, uidMaps, gidMaps []idtools.IDMap) (driver Driver, err error)\n```\nNew creates the driver and initializes it at the specified root.\n\n```go\nfunc NewNaiveDiffDriver(driver ProtoDriver, uidMaps, gidMaps []idtools.IDMap) Driver\n```\nNewNaiveDiffDriver 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:\n\n\tDiff(id, parent string) (archive.Archive, error)\n\tChanges(id, parent string) ([]archive.Change, error)\n\tApplyDiff(id, parent string, diff archive.Reader) (size int64, err error)\n\tDiffSize(id, parent string) (size int64, err error)\n\n```go\ntype FsMagic uint32\n```\nFsMagic unsigned id of the filesystem in use.\n\n```go\nfunc GetFSMagic(rootpath string) (FsMagic, error)\n```\nGetFSMagic returns the filesystem id given the path.\n\n```go\ntype InitFunc func(root string, options []string, uidMaps, gidMaps []idtools.IDMap) (Driver, error)\n```\nInitFunc initializes the storage driver.\n\n```go\ntype NaiveDiffDriver struct {\n\tProtoDriver\n\t// contains filtered or unexported fields\n}\n```\nNaiveDiffDriver takes a ProtoDriver and adds the capability of the Diffing methods which it may or may not support on its own. See the comment on the exported NewNaiveDiffDriver function below. Notably, the AUFS driver doesn't need to be wrapped like this.\n\n```go\nfunc (gdw *NaiveDiffDriver) ApplyDiff(id, parent string, diff archive.Reader) (size int64, err error)\n```\nApplyDiff 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.\n\n```go\nfunc (gdw *NaiveDiffDriver) Changes(id, parent string) ([]archive.Change, error)\n```\nChanges produces a list of changes between the specified layer and its parent layer. If parent is \"\", then all changes will be ADD changes.\n\n```go\nfunc (gdw *NaiveDiffDriver) Diff(id, parent string) (arch archive.Archive, err error)\n```\nDiff produces an archive of the changes between the specified layer and its parent layer which may be \"\".\n\n```go\nfunc (gdw *NaiveDiffDriver) DiffSize(id, parent string) (size int64, err error)\n```\nDiffSize calculates the changes between the specified layer and its parent and returns the size in bytes of the changes relative to its base filesystem directory.\n\n```go\ntype ProtoDriver interface {\n\t// String returns a string representation of this driver.\n\tString() string\n\t// Create creates a new, empty, filesystem layer with the\n\t// specified id and parent and mountLabel. Parent and mountLabel may be \"\".\n\tCreate(id, parent, mountLabel string) error\n\t// Remove attempts to remove the filesystem layer with this id.\n\tRemove(id string) error\n\t// Get returns the mountpoint for the layered filesystem referred\n\t// to by this id. You can optionally specify a mountLabel or \"\".\n\t// Returns the absolute path to the mounted layered filesystem.\n\tGet(id, mountLabel string) (dir string, err error)\n\t// Put releases the system resources for the specified id,\n\t// e.g, unmounting layered filesystem.\n\tPut(id string) error\n\t// Exists returns whether a filesystem layer with the specified\n\t// ID exists on this driver.\n\tExists(id string) bool\n\t// Status returns a set of key-value pairs which give low\n\t// level diagnostic status about this driver.\n\tStatus() [][2]string\n\t// Returns a set of key-value pairs which give low level information\n\t// about the image/container driver is managing.\n\tGetMetadata(id string) (map[string]string, error)\n\t// Cleanup performs necessary tasks to release resources\n\t// held by the driver, e.g., unmounting all layered filesystems\n\t// known to this driver.\n\tCleanup() error\n}\n```\nProtoDriver 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.\n\nUse of ProtoDriver directly by client code is not recommended.\n\n","path":"github.com/hyperhq/hypercli/daemon/graphdriver","name":"graphdriver","synopsis":"","isRedistributable":true}
