local

package
v1.4.2-0...-8562c42 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package local provides the default implementation for volumes. It is used to mount data volume containers and directories local to the host server.

Index

Constants

View Source
const (
	VolumeDataPathName = "_data"
)

VolumeDataPathName is the name of the directory where the volume data is stored. It uses a very distintive name to avoid collisions migrating data between Docker versions.

Variables

View Source
var (
	// ErrNotFound is the typed error returned when the requested volume name can't be found
	ErrNotFound = errors.New("volume not found")
)

Functions

This section is empty.

Types

type Root

type Root struct {
	// contains filtered or unexported fields
}

Root implements the Driver interface for the volume package and manages the creation/removal of volumes. It uses only standard vfs commands to create/remove dirs within its provided scope.

func New

func New(scope string) (*Root, error)

New instantiates a new Root instance with the provided scope. Scope is the base path that the Root instance uses to store its volumes. The base path is created here if it does not exist.

func (*Root) Create

func (r *Root) Create(name string, _ map[string]string) (volume.Volume, error)

Create creates a new volume.Volume with the provided name, creating the underlying directory tree required for this volume in the process.

func (*Root) DataPath

func (r *Root) DataPath(volumeName string) string

DataPath returns the constructed path of this volume.

func (*Root) Get

func (r *Root) Get(name string) (volume.Volume, error)

Get looks up the volume for the given name and returns it if found

func (*Root) List

func (r *Root) List() []volume.Volume

List lists all the volumes

func (*Root) Name

func (r *Root) Name() string

Name returns the name of Root, defined in the volume package in the DefaultDriverName constant.

func (*Root) Remove

func (r *Root) Remove(v volume.Volume) error

Remove removes the specified volume and all underlying data. If the given volume does not belong to this driver and an error is returned. The volume is reference counted, if all references are not released then the volume is not removed.

Jump to

Keyboard shortcuts

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