dynamicfs

package
v0.0.0-...-83118d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2017 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDynamicFS

func NewDynamicFS(clock timeutil.Clock) (server fuse.Server, err error)

Create a file system that contains 2 files (`age` and `weekday`) and no directories. Every time the `age` file is opened, its contents are refreshed to show the number of seconds elapsed since the file system was created (as opposed to mounted). Every time the `weekday` file is opened, its contents are refreshed to reflect the current weekday.

The contents of both of these files is updated within the filesystem itself, i.e., these changes do not go through the kernel. Additionally, file access times are not updated and file size is not known in advance and is set to 0. This simulates a filesystem that is backed by a dynamic data source where file metadata is not necessarily known before the file is read. For example, a filesystem backed by an expensive RPC or by a stream that's generated on the fly might not know data size ahead of time.

This implementation depends on direct IO in fuse. Without it, all read operations are suppressed because the kernel detects that they read beyond the end of the files.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL