volume

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2016 License: BSD-2-Clause, Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDriverName string = "local"

DefaultDriverName is the driver name used for the driver implemented in the local package.

Variables

This section is empty.

Functions

func ReadWrite

func ReadWrite(mode string) bool

ReadWrite tells you if a mode string is a valid read-only mode or not.

func ValidateMountMode

func ValidateMountMode(mode string) (bool, bool)

ValidateMountMode will make sure the mount mode is valid. returns if it's a valid mount mode and if it's read-write or not.

Types

type Driver

type Driver interface {
	// Name returns the name of the volume driver.
	Name() string
	// Create makes a new volume with the given id.
	Create(string) (Volume, error)
	// Remove deletes the volume.
	Remove(Volume) error
}

Driver is for creating and removing volumes.

type Volume

type Volume interface {
	// Name returns the name of the volume
	Name() string
	// DriverName returns the name of the driver which owns this volume.
	DriverName() string
	// Path returns the absolute path to the volume.
	Path() string
	// Mount mounts the volume and returns the absolute path to
	// where it can be consumed.
	Mount() (string, error)
	// Unmount unmounts the volume when it is no longer in use.
	Unmount() error
}

Volume is a place to store data. It is backed by a specific driver, and can be mounted.

Jump to

Keyboard shortcuts

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