converge: github.com/asteris-llc/converge/resource/docker/volume Index | Files

package volume

import "github.com/asteris-llc/converge/resource/docker/volume"

Index

Package Files

preparer.go volume.go

type Preparer Uses

type Preparer struct {
    // name of the volume
    Name string `hcl:"name" required:"true" nonempty:"true"`

    // volume driver. default: local
    Driver string `hcl:"driver" default:"local"`

    // labels to set on the volume
    Labels map[string]string `hcl:"labels"`

    // driver specific options
    Options map[string]string `hcl:"options"`

    // indicates whether the volume should exist.
    State State `hcl:"state" valid_values:"present,absent"`

    // indicates whether or not the volume will be recreated if the state is not
    // what is expected. By default, the module will only check to see if the
    // volume exists. Specified as a boolean value
    Force bool `hcl:"force"`
}

Preparer for docker volumes

Volume is responsible for managing Docker volumes. It assumes that there is already a Docker daemon running on the system. *Note: docker resources are not currently supported on Solaris.*

func (*Preparer) Prepare Uses

func (p *Preparer) Prepare(ctx context.Context, render resource.Renderer) (resource.Task, error)

Prepare a docker volume

type State Uses

type State string

State type for Volume

const (
    // StatePresent indicates the volume should be present
    StatePresent State = "present"

    // StateAbsent indicates the volume should be absent
    StateAbsent State = "absent"
)

type Volume Uses

type Volume struct {

    // volume name
    Name string `export:"name"`

    // volume labels
    Labels map[string]string `export:"labels"`

    // driver the volume is configured to use
    Driver string `export:"driver"`

    // driver-specific options
    Options map[string]string `export:"options"`

    // volume state
    State State `export:"state"`

    // reflects whether or not the force option was configured
    Force bool `export:"force"`
    // contains filtered or unexported fields
}

Volume is responsible for managing docker volumes

func (*Volume) Apply Uses

func (v *Volume) Apply(context.Context) (resource.TaskStatus, error)

Apply ensures the volume matches the desired state

func (*Volume) Check Uses

func (v *Volume) Check(context.Context, resource.Renderer) (resource.TaskStatus, error)

Check system for docker volume

func (*Volume) SetClient Uses

func (v *Volume) SetClient(client docker.VolumeClient)

SetClient injects a docker api client

Package volume imports 8 packages (graph) and is imported by 1 packages. Updated 2017-01-13. Refresh now. Tools for package owners.