github.com/rita33cool1/iot-system-gateway@v0.0.0-20200911033302-e65bde238cc5/docker-engine/volume/volume_copy.go (about)

     1  package volume // import "github.com/docker/docker/volume"
     2  
     3  import "strings"
     4  
     5  // {<copy mode>=isEnabled}
     6  var copyModes = map[string]bool{
     7  	"nocopy": false,
     8  }
     9  
    10  func copyModeExists(mode string) bool {
    11  	_, exists := copyModes[mode]
    12  	return exists
    13  }
    14  
    15  // GetCopyMode gets the copy mode from the mode string for mounts
    16  func getCopyMode(mode string, def bool) (bool, bool) {
    17  	for _, o := range strings.Split(mode, ",") {
    18  		if isEnabled, exists := copyModes[o]; exists {
    19  			return isEnabled, true
    20  		}
    21  	}
    22  	return def, false
    23  }