Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileSystem ¶
func NewFileSystem( ctx context.Context, cfg *ServerConfig) (fuseutil.FileSystem, error)
Create a fuse file system server according to the supplied configuration.
Types ¶
type ServerConfig ¶
type ServerConfig struct { // A clock used for cache expiration. It is *not* used for inode times, for // which we use the wall clock. CacheClock timeutil.Clock // The bucket manager is responsible for setting up buckets. BucketManager gcsx.BucketManager // The name of the specific GCS bucket to be mounted. If it's empty or "_", // all accessible GCS buckets are mounted as subdirectories of the FS root. BucketName string // LocalFileCache LocalFileCache bool // Enable debug messages DebugFS bool // The temporary directory to use for local caching, or the empty string to // use the system default. TempDir string // By default, if a bucket contains the object "foo/bar" but no object named // "foo/", it's as if the directory doesn't exist. This allows us to have // non-flaky name resolution code. // // Setting this bool to true enables a mode where object listings are // consulted to allow for the directory in the situation above to exist. Note // that this has drawbacks in the form of name resolution flakiness and // surprising behavior. // // See docs/semantics.md for more info. ImplicitDirectories bool // By default, if a file/directory does not exist in GCS, this nonexistent state is // not cached in type cache. So the inode lookup request will hit GCS every // time. // // Setting this bool to true enables the nonexistent type cache so if the // inode state is NonexistentType in type cache, the lookup request will // return nil immediately. EnableNonexistentTypeCache bool // How long to allow the kernel to cache inode attributes. // // Any given object generation in GCS is immutable, and a new generation // results in a new inode number. So every update from a remote system results // in a new inode number, and it's therefore safe to allow the kernel to cache // inode attributes. // // The one exception to the above logic is that objects can be _deleted_, in // which case stat::st_nlink changes. So choosing this value comes down to // whether you care about that field being up to date. InodeAttributeCacheTTL time.Duration // If non-zero, each directory will maintain a cache from child name to // information about whether that name exists as a file and/or directory. // This may speed up calls to look up and stat inodes, especially when // combined with a stat-caching GCS bucket, but comes at the cost of // consistency: if the child is removed and recreated with a different type // before the expiration, we may fail to find it. DirTypeCacheTTL time.Duration // The UID and GID that owns all inodes in the file system. Uid uint32 Gid uint32 // Permissions bits to use for files and directories. No bits outside of // os.ModePerm may be set. FilePerms os.FileMode DirPerms os.FileMode // Allow renaming a directory containing fewer descendants than this limit. RenameDirLimit int64 // File chunk size to read from GCS in one call. Specified in MB. SequentialReadSizeMb int32 // MountConfig has all the config specified by the user using configFile flag. MountConfig *config.MountConfig }
Click to show internal directories.
Click to hide internal directories.