mirror of
https://github.com/rclone/rclone.git
synced 2024-12-21 11:06:55 +08:00
1cc22da87d
This almost 100% backwards compatible. The only difference being that in the rc options/get output CacheMode will be output as strings instead of integers. This is a lot more convenient for the user. They still accept integer inputs though so the fallout from this should be minimal.
34 lines
880 B
Go
34 lines
880 B
Go
// Package vfscommon provides utilities for VFS.
|
|
package vfscommon
|
|
|
|
import (
|
|
"github.com/rclone/rclone/fs"
|
|
)
|
|
|
|
type cacheModeChoices struct{}
|
|
|
|
func (cacheModeChoices) Choices() []string {
|
|
return []string{
|
|
CacheModeOff: "off",
|
|
CacheModeMinimal: "minimal",
|
|
CacheModeWrites: "writes",
|
|
CacheModeFull: "full",
|
|
}
|
|
}
|
|
|
|
// CacheMode controls the functionality of the cache
|
|
type CacheMode = fs.Enum[cacheModeChoices]
|
|
|
|
// CacheMode options
|
|
const (
|
|
CacheModeOff CacheMode = iota // cache nothing - return errors for writes which can't be satisfied
|
|
CacheModeMinimal // cache only the minimum, e.g. read/write opens
|
|
CacheModeWrites // cache all files opened with write intent
|
|
CacheModeFull // cache all files opened in any mode
|
|
)
|
|
|
|
// Type of the value
|
|
func (cacheModeChoices) Type() string {
|
|
return "CacheMode"
|
|
}
|