volume

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mount

type Mount struct {
	Source     string
	Target     string
	Permission Permission
}

Mount describes mount settings.

func NewMount

func NewMount(spec string) (Mount, error)

NewMount constructs a new mount settings from the Docker representation in the following format: `VolumeName:ContainerDestination:ro`. For example: `cifs:/mnt:ro`.

func (Mount) ReadOnly

func (m Mount) ReadOnly() bool

ReadOnly returns true if this mount is read-only.

type Option

type Option func(options interface{}) error

Option specifies how a Docker plugin can be configured.

func WithOptions

func WithOptions(options map[string]string) Option

WithOptions constructs an option that forwards the given generic options to the plugin.

func WithPluginSocketDir

func WithPluginSocketDir(path string) Option

WithPluginSocketDir constructs an option that specifies the plugin directory where Unix sockets live.

type Options

type Options struct {
	SocketDir string
}

Options describes generic volume plugin options.

type Permission

type Permission uint32
const (
	RW Permission = iota
	RO
)

func ParsePermission

func ParsePermission(mode string) (Permission, error)

type Volume

type Volume interface {
	// Configure mutates the specified host config applying required settings.
	Configure(mount Mount, cfg *container.HostConfig) error
}

Volume specifies volume interface, that is mounted within Docker containers.

type VolumeDriver

type VolumeDriver interface {
	// CreateVolume creates a new volume using specified name and Option.
	CreateVolume(name string, options map[string]string) (Volume, error)
	// RemoveVolume removes an existing volume.
	RemoveVolume(name string) error
	// Close closes this driver, freeing all associated resources.
	Close() error
}

VolumeDriver specifies volume driver interface, providing abilities to create new volumes for containers.

func NewCIFSVolumeDriver

func NewCIFSVolumeDriver(ctx context.Context, options ...Option) (VolumeDriver, error)

NewCIFSVolumeDriver constructs and runs a new CIFS volume driver within the provided error group.

func NewNilVolumeDriver

func NewNilVolumeDriver() VolumeDriver

NewNilVolumeDriver constructs a new volume driver that does nothing.

Used primarily in systems that are unable to manage Docker plugins for to be able to at least start the Worker.

func NewVolumeDriver

func NewVolumeDriver(ctx context.Context, ty string, options ...Option) (VolumeDriver, error)

NewVolumeDriver constructs a new volume driver.

Jump to

Keyboard shortcuts

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