volume

package
v0.0.0-...-e995b2c Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListCommonOptions

func ListCommonOptions() map[string]types.Option

ListCommonOptions returns common options.

Types

type Config

type Config struct {
	ControlAddress string
	Timeout        time.Duration // operation timeout.
	RemoveVolume   bool
	DefaultBackend string
	VolumeMetaPath string
}

Config represents volume config struct.

type Core

type Core struct {
	Config
	BaseURL       string
	EnableControl bool
}

Core represents volume core struct.

func NewCore

func NewCore(cfg Config) (*Core, error)

NewCore returns Core struct instance with volume config.

func (*Core) AttachVolume

func (c *Core) AttachVolume(id types.VolumeID, extra map[string]string) (*types.Volume, error)

AttachVolume to enable a volume on local host.

func (*Core) CreateVolume

func (c *Core) CreateVolume(id types.VolumeID) error

CreateVolume use to create a volume, if failed, will return error info.

func (*Core) DetachVolume

func (c *Core) DetachVolume(id types.VolumeID, extra map[string]string) (*types.Volume, error)

DetachVolume to disable a volume on local host.

func (*Core) ExistVolume

func (c *Core) ExistVolume(id types.VolumeID) (bool, error)

ExistVolume return 'true' if volume be found and not errors.

func (*Core) GetVolume

func (c *Core) GetVolume(id types.VolumeID) (*types.Volume, error)

GetVolume return a volume's info with specified name, If not errors.

func (*Core) GetVolumeDriver

func (c *Core) GetVolumeDriver(id types.VolumeID) (*types.Volume, driver.Driver, error)

GetVolumeDriver return the backend driver and volume with specified volume's id.

func (*Core) ListVolumeName

func (c *Core) ListVolumeName(labels map[string]string) ([]string, error)

ListVolumeName return the name of all volumes only. Param 'labels' use to filter the volume's names, only return those you want.

func (*Core) RemoveVolume

func (c *Core) RemoveVolume(id types.VolumeID) error

RemoveVolume remove volume from storage and meta information, if not success return error.

func (*Core) VolumePath

func (c *Core) VolumePath(id types.VolumeID) (string, error)

VolumePath return the path of volume on node host.

Directories

Path Synopsis
examples
modules

Jump to

Keyboard shortcuts

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