diff options
Diffstat (limited to 'volume/volume_copy.go')
-rw-r--r-- | volume/volume_copy.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/volume/volume_copy.go b/volume/volume_copy.go new file mode 100644 index 0000000..77f06a0 --- /dev/null +++ b/volume/volume_copy.go @@ -0,0 +1,23 @@ +package volume + +import "strings" + +// {<copy mode>=isEnabled} +var copyModes = map[string]bool{ + "nocopy": false, +} + +func copyModeExists(mode string) bool { + _, exists := copyModes[mode] + return exists +} + +// GetCopyMode gets the copy mode from the mode string for mounts +func getCopyMode(mode string) (bool, bool) { + for _, o := range strings.Split(mode, ",") { + if isEnabled, exists := copyModes[o]; exists { + return isEnabled, true + } + } + return DefaultCopyMode, false +} |