mirror of
https://github.com/genuinetools/reg.git
synced 2024-08-21 22:30:22 -04:00
24 lines
473 B
Go
24 lines
473 B
Go
![]() |
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, def bool) (bool, bool) {
|
||
|
for _, o := range strings.Split(mode, ",") {
|
||
|
if isEnabled, exists := copyModes[o]; exists {
|
||
|
return isEnabled, true
|
||
|
}
|
||
|
}
|
||
|
return def, false
|
||
|
}
|