package local
import "github.com/docker/cli/components/engine/volume/local"
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
- Variables
- type Root
- func New(scope string, rootIDs idtools.IDPair) (*Root, error)
- func (r *Root) Create(name string, opts map[string]string) (volume.Volume, error)
- func (r *Root) DataPath(volumeName string) string
- func (r *Root) Get(name string) (volume.Volume, error)
- func (r *Root) List() ([]volume.Volume, error)
- func (r *Root) Name() string
- func (r *Root) Remove(v volume.Volume) error
- func (r *Root) Scope() string
Constants ¶
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 ¶
var ( // ErrNotFound is the typed error returned when the requested volume name can't be found ErrNotFound = fmt.Errorf("volume not found") )
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 ¶
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 ¶
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 ¶
DataPath returns the constructed path of this volume.
func (*Root) Get ¶
Get looks up the volume for the given name and returns it if found
func (*Root) List ¶
List lists all the volumes
func (*Root) Name ¶
Name returns the name of Root, defined in the volume package in the DefaultDriverName constant.
func (*Root) Remove ¶
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 ¶
Scope returns the local volume scope
Source Files ¶
- Version
- v17.11.0-ce-rc3+incompatible
- Published
- Nov 8, 2017
- Platform
- js/wasm
- Imports
- 14 packages
- Last checked
- 9 minutes ago –
Tools for package owners.