volume

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerFactory

type DockerFactory struct {
	ClientFactory composeclient.Factory
}

DockerFactory implements project.VolumesFactory

func (*DockerFactory) Create

func (f *DockerFactory) Create(projectName string, volumeConfigs map[string]*config.VolumeConfig, serviceConfigs *config.ServiceConfigs, volumeEnabled bool) (project.Volumes, error)

Create implements project.VolumesFactory Create method. It creates a Volumes (that implements project.Volumes) from specified configurations.

type Volume

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

Volume holds attributes and method for a volume definition in compose

func NewVolume

func NewVolume(projectName, name string, config *config.VolumeConfig, client client.VolumeAPIClient) *Volume

NewVolume creates a new volume from the specified name and config.

func (*Volume) EnsureItExists

func (v *Volume) EnsureItExists(ctx context.Context) error

EnsureItExists make sure the volume exists and return an error if it does not exists and cannot be created.

func (*Volume) Inspect

func (v *Volume) Inspect(ctx context.Context) (types.Volume, error)

Inspect inspect the current volume

func (*Volume) Remove

func (v *Volume) Remove(ctx context.Context) error

Remove removes the current volume (from docker engine)

type Volumes

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

Volumes holds a list of volume

func VolumesFromServices

func VolumesFromServices(cli client.VolumeAPIClient, projectName string, volumeConfigs map[string]*config.VolumeConfig, services *config.ServiceConfigs, volumeEnabled bool) (*Volumes, error)

VolumesFromServices creates a new Volumes struct based on volumes configurations and services configuration. If a volume is defined but not used by any service, it will return an error along the Volumes.

func (*Volumes) Initialize

func (v *Volumes) Initialize(ctx context.Context) error

Initialize make sure volume exists if volume is enabled

func (*Volumes) Remove

func (v *Volumes) Remove(ctx context.Context) error

Remove removes volumes (clean-up)

Jump to

Keyboard shortcuts

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