github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/vfs/vfscommon/options.go (about)

     1  package vfscommon
     2  
     3  import (
     4  	"os"
     5  	"runtime"
     6  	"time"
     7  
     8  	"github.com/rclone/rclone/fs"
     9  )
    10  
    11  // Options is options for creating the vfs
    12  type Options struct {
    13  	NoSeek            bool          // don't allow seeking if set
    14  	NoChecksum        bool          // don't check checksums if set
    15  	ReadOnly          bool          // if set VFS is read only
    16  	NoModTime         bool          // don't read mod times for files
    17  	DirCacheTime      time.Duration // how long to consider directory listing cache valid
    18  	PollInterval      time.Duration
    19  	Umask             int
    20  	UID               uint32
    21  	GID               uint32
    22  	DirPerms          os.FileMode
    23  	FilePerms         os.FileMode
    24  	ChunkSize         fs.SizeSuffix // if > 0 read files in chunks
    25  	ChunkSizeLimit    fs.SizeSuffix // if > ChunkSize double the chunk size after each chunk until reached
    26  	CacheMode         CacheMode
    27  	CacheMaxAge       time.Duration
    28  	CacheMaxSize      fs.SizeSuffix
    29  	CachePollInterval time.Duration
    30  	CaseInsensitive   bool
    31  	WriteWait         time.Duration // time to wait for in-sequence write
    32  	ReadWait          time.Duration // time to wait for in-sequence read
    33  }
    34  
    35  // DefaultOpt is the default values uses for Opt
    36  var DefaultOpt = Options{
    37  	NoModTime:         false,
    38  	NoChecksum:        false,
    39  	NoSeek:            false,
    40  	DirCacheTime:      5 * 60 * time.Second,
    41  	PollInterval:      time.Minute,
    42  	ReadOnly:          false,
    43  	Umask:             0,
    44  	UID:               ^uint32(0), // these values instruct WinFSP-FUSE to use the current user
    45  	GID:               ^uint32(0), // overridden for non windows in mount_unix.go
    46  	DirPerms:          os.FileMode(0777),
    47  	FilePerms:         os.FileMode(0666),
    48  	CacheMode:         CacheModeOff,
    49  	CacheMaxAge:       3600 * time.Second,
    50  	CachePollInterval: 60 * time.Second,
    51  	ChunkSize:         128 * fs.MebiByte,
    52  	ChunkSizeLimit:    -1,
    53  	CacheMaxSize:      -1,
    54  	CaseInsensitive:   runtime.GOOS == "windows" || runtime.GOOS == "darwin", // default to true on Windows and Mac, false otherwise
    55  	WriteWait:         1000 * time.Millisecond,
    56  	ReadWait:          20 * time.Millisecond,
    57  }