libcompose: github.com/docker/libcompose/docker/volume Index | Files

package volume

import "github.com/docker/libcompose/docker/volume"

Index

Package Files

volume.go

type DockerFactory Uses

type DockerFactory struct {
    ClientFactory composeclient.Factory
}

DockerFactory implements project.VolumesFactory

func (*DockerFactory) Create Uses

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 Uses

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

Volume holds attributes and method for a volume definition in compose

func NewVolume Uses

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 Uses

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 Uses

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

Inspect inspect the current volume

func (*Volume) Remove Uses

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

Remove removes the current volume (from docker engine)

type Volumes Uses

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

Volumes holds a list of volume

func VolumesFromServices Uses

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 Uses

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

Initialize make sure volume exists if volume is enabled

func (*Volumes) Remove Uses

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

Remove removes volumes (clean-up)

Package volume imports 8 packages (graph) and is imported by 5 packages. Updated 2017-11-15. Refresh now. Tools for package owners.