Documentation ¶
Index ¶
- Constants
- func NewDefaultAttributesInjectingRawFileSystem(base fuse.RawFileSystem, entryValid, attrValid time.Duration, attr *fuse.Attr) fuse.RawFileSystem
- func NewMetricsRawFileSystem(base fuse.RawFileSystem, clock clock.Clock) fuse.RawFileSystem
- func NewSimpleRawFileSystem(rootDirectory virtual.Directory, ...) fuse.RawFileSystem
- func SetLinuxBackingDevInfoTunables(mountPath string, variables map[string]string) error
- type Authenticator
Constants ¶
const ( // AttributesMaskForFUSEAttr is the attributes mask to use for // VirtualGetAttributes() to populate all relevant fields of // fuse.Attr. AttributesMaskForFUSEAttr = virtual.AttributesMaskDeviceNumber | virtual.AttributesMaskFileType | virtual.AttributesMaskInodeNumber | virtual.AttributesMaskLastDataModificationTime | virtual.AttributesMaskLinkCount | virtual.AttributesMaskPermissions | virtual.AttributesMaskSizeBytes // AttributesMaskForFUSEDirEntry is the attributes mask to use // for VirtualReadDir() to populate all relevant fields of // fuse.DirEntry. AttributesMaskForFUSEDirEntry = virtual.AttributesMaskFileType | virtual.AttributesMaskInodeNumber )
Variables ¶
This section is empty.
Functions ¶
func NewDefaultAttributesInjectingRawFileSystem ¶
func NewDefaultAttributesInjectingRawFileSystem(base fuse.RawFileSystem, entryValid, attrValid time.Duration, attr *fuse.Attr) fuse.RawFileSystem
NewDefaultAttributesInjectingRawFileSystem creates a decorator for RawFileSystem that places default values into AttrOut and EntryOut structures before they are passed on to FUSE operations. This means their values are only retained if the underlying implementation doesn't fill in values explicitly.
Use cases of this decorator include filling in default entry/attribute validity durations, file modification times, file ownership, etc.
func NewMetricsRawFileSystem ¶
func NewMetricsRawFileSystem(base fuse.RawFileSystem, clock clock.Clock) fuse.RawFileSystem
NewMetricsRawFileSystem creates a decorator for fuse.RawFileSystem that exposes Prometheus metrics for each of the operations invoked.
func NewSimpleRawFileSystem ¶
func NewSimpleRawFileSystem(rootDirectory virtual.Directory, removalNotifierRegistrar virtual.FUSERemovalNotifierRegistrar, authenticator Authenticator) fuse.RawFileSystem
NewSimpleRawFileSystem creates a go-fuse RawFileSystem that converts flat FUSE operations to calls against a hierarchy of Directory and Leaf objects.
This implementation is comparable to the RawFileSystem implementations created using go-fuse's fs.NewNodeFS() and nodefs.FileSystemConnector.RawFS(), except that it is simpler. It does not contain an inode number allocator, nor does it attempt to keep track of files stored in a directory. Tracking this information is the responsibility of the Directory and Leaf implementations.
FUSE as a protocol makes no true distinction between Directory and Leaf objects. This implementation could therefore have been simplified a bit by merging these two interface types together. Separation between these two interfaces was added to make it easier to understand which operations actually get called against a given object type.
func SetLinuxBackingDevInfoTunables ¶
SetLinuxBackingDevInfoTunables adjusts tunables of the Linux Backing Dev Info (BDI) belonging to a FUSE mount. These tunables can, for example, be used to increase the maximum number of dirty pages belonging to the mount.
This implementation applies the tunables through Linux's sysfs.
Types ¶
type Authenticator ¶
type Authenticator interface {
Authenticate(ctx context.Context, caller *fuse.Caller) (context.Context, fuse.Status)
}
Authenticator of incoming FUSE requests.
var AllowAuthenticator Authenticator = allowAuthenticator{}
AllowAuthenticator is an implementation of Authenticator that simply permits all incoming requests. No authentication metadata is attached to the context.
func NewInHeaderAuthenticator ¶
func NewInHeaderAuthenticator(metadataExtractor *jmespath.JMESPath) Authenticator
NewInHeaderAuthenticator creates an Authenticator that obtains authentication metadata from an incoming FUSE request by inspecting the "fuse_in_header" structure that's provided by the kernel. This structure contains the user ID, group ID and process ID of the calling process.