local

package
v18.9.14+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: Apache-2.0 Imports: 17 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.

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 distinctive 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 = fmt.Errorf("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, rootIdentity idtools.Identity) (*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, opts 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, error)

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.

func (*Root) Scope

func (r *Root) Scope() string

Scope returns the local volume scope

Jump to

Keyboard shortcuts

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