github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/api/types/mount/mount.go (about)

     1  package mount
     2  
     3  // Type represents the type of a mount.
     4  type Type string
     5  
     6  const (
     7  	// TypeBind BIND
     8  	TypeBind Type = "bind"
     9  	// TypeVolume VOLUME
    10  	TypeVolume Type = "volume"
    11  )
    12  
    13  // Mount represents a mount (volume).
    14  type Mount struct {
    15  	Type     Type   `json:",omitempty"`
    16  	Source   string `json:",omitempty"`
    17  	Target   string `json:",omitempty"`
    18  	ReadOnly bool   `json:",omitempty"`
    19  
    20  	BindOptions   *BindOptions   `json:",omitempty"`
    21  	VolumeOptions *VolumeOptions `json:",omitempty"`
    22  }
    23  
    24  // Propagation represents the propagation of a mount.
    25  type Propagation string
    26  
    27  const (
    28  	// PropagationRPrivate RPRIVATE
    29  	PropagationRPrivate Propagation = "rprivate"
    30  	// PropagationPrivate PRIVATE
    31  	PropagationPrivate Propagation = "private"
    32  	// PropagationRShared RSHARED
    33  	PropagationRShared Propagation = "rshared"
    34  	// PropagationShared SHARED
    35  	PropagationShared Propagation = "shared"
    36  	// PropagationRSlave RSLAVE
    37  	PropagationRSlave Propagation = "rslave"
    38  	// PropagationSlave SLAVE
    39  	PropagationSlave Propagation = "slave"
    40  )
    41  
    42  // BindOptions defines options specific to mounts of type "bind".
    43  type BindOptions struct {
    44  	Propagation Propagation `json:",omitempty"`
    45  }
    46  
    47  // VolumeOptions represents the options for a mount of type volume.
    48  type VolumeOptions struct {
    49  	NoCopy       bool              `json:",omitempty"`
    50  	Labels       map[string]string `json:",omitempty"`
    51  	DriverConfig *Driver           `json:",omitempty"`
    52  }
    53  
    54  // Driver represents a volume driver.
    55  type Driver struct {
    56  	Name    string            `json:",omitempty"`
    57  	Options map[string]string `json:",omitempty"`
    58  }