Documentation
¶
Overview ¶
Package fusefrontend interfaces directly with the go-fuse library.
Index ¶
- Constants
- func NewFile(fd *os.File, fs *FS) (nodefs.File, fuse.Status)
- type Args
- type FS
- func (fs *FS) Access(path string, mode uint32, context *fuse.Context) (code fuse.Status)
- func (fs *FS) Chmod(path string, mode uint32, context *fuse.Context) (code fuse.Status)
- func (fs *FS) Chown(path string, uid uint32, gid uint32, context *fuse.Context) (code fuse.Status)
- func (fs *FS) Create(path string, flags uint32, mode uint32, context *fuse.Context) (fuseFile nodefs.File, code fuse.Status)
- func (fs *FS) DecryptPath(cipherPath string) (string, error)
- func (fs *FS) EncryptPath(plainPath string) (string, error)
- func (fs *FS) GetAttr(name string, context *fuse.Context) (*fuse.Attr, fuse.Status)
- func (fs *FS) GetXAttr(name string, attr string, context *fuse.Context) ([]byte, fuse.Status)
- func (fs *FS) Link(oldPath string, newPath string, context *fuse.Context) (code fuse.Status)
- func (fs *FS) ListXAttr(name string, context *fuse.Context) ([]string, fuse.Status)
- func (fs *FS) Mkdir(newPath string, mode uint32, context *fuse.Context) (code fuse.Status)
- func (fs *FS) Mknod(path string, mode uint32, dev uint32, context *fuse.Context) (code fuse.Status)
- func (fs *FS) Open(path string, flags uint32, context *fuse.Context) (fuseFile nodefs.File, status fuse.Status)
- func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, fuse.Status)
- func (fs *FS) Readlink(path string, context *fuse.Context) (out string, status fuse.Status)
- func (fs *FS) RemoveXAttr(name string, attr string, context *fuse.Context) fuse.Status
- func (fs *FS) Rename(oldPath string, newPath string, context *fuse.Context) (code fuse.Status)
- func (fs *FS) Rmdir(path string, context *fuse.Context) (code fuse.Status)
- func (fs *FS) SetXAttr(name string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status
- func (fs *FS) StatFs(path string) *fuse.StatfsOut
- func (fs *FS) Symlink(target string, linkName string, context *fuse.Context) (code fuse.Status)
- func (fs *FS) Truncate(path string, offset uint64, context *fuse.Context) (code fuse.Status)
- func (fs *FS) Unlink(path string, context *fuse.Context) (code fuse.Status)
- func (fs *FS) Utimens(path string, a *time.Time, m *time.Time, context *fuse.Context) (code fuse.Status)
Constants ¶
const FALLOC_DEFAULT = 0x00
FALLOC_DEFAULT is a "normal" fallocate operation
const FALLOC_FL_KEEP_SIZE = 0x01
FALLOC_FL_KEEP_SIZE allocates disk space while not modifying the file size
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Args ¶
type Args struct {
// Cipherdir is the backing storage directory (absolute path).
// For reverse mode, Cipherdir actually contains *plaintext* files.
Cipherdir string
PlaintextNames bool
LongNames bool
// Should we chown a file after it has been created?
// This only makes sense if (1) allow_other is set and (2) we run as root.
PreserveOwner bool
// Should we force ownership to be presented with a given user and group?
// This only makes sense if allow_other is set. In *most* cases, it also
// only makes sense with PreserveOwner set, but can also make sense without
// PreserveOwner if the underlying filesystem acting as backing store
// enforces ownership itself.
ForceOwner *fuse.Owner
// ConfigCustom is true when the user select a non-default config file
// location. If it is false, reverse mode maps ".gocryptfs.reverse.conf"
// to "gocryptfs.conf" in the plaintext dir.
ConfigCustom bool
// NoPrealloc disables automatic preallocation before writing
NoPrealloc bool
// Try to serialize read operations, "-serialize_reads"
SerializeReads bool
// Force decode even if integrity check fails (openSSL only)
ForceDecode bool
}
Args is a container for arguments that are passed from main() to fusefrontend
type FS ¶
type FS struct {
pathfs.FileSystem // loopbackFileSystem, see go-fuse/fuse/pathfs/loopback.go
// contains filtered or unexported fields
}
FS implements the go-fuse virtual filesystem interface.
func NewFS ¶
func NewFS(args Args, c *contentenc.ContentEnc, n *nametransform.NameTransform) *FS
NewFS returns a new encrypted FUSE overlay filesystem.
func (*FS) Create ¶
func (fs *FS) Create(path string, flags uint32, mode uint32, context *fuse.Context) (fuseFile nodefs.File, code fuse.Status)
Create implements pathfs.Filesystem.
func (*FS) DecryptPath ¶ added in v1.2.1
DecryptPath implements ctlsock.Backend
func (*FS) EncryptPath ¶ added in v1.2.1
EncryptPath implements ctlsock.Backend
func (*FS) Open ¶
func (fs *FS) Open(path string, flags uint32, context *fuse.Context) (fuseFile nodefs.File, status fuse.Status)
Open implements pathfs.Filesystem.
func (*FS) RemoveXAttr ¶
RemoveXAttr implements pathfs.Filesystem.
func (*FS) SetXAttr ¶
func (fs *FS) SetXAttr(name string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status
SetXAttr implements pathfs.Filesystem.
func (*FS) Truncate ¶
Truncate implements pathfs.Filesystem. Support truncate(2) by opening the file and calling ftruncate(2) While the glibc "truncate" wrapper seems to always use ftruncate, fsstress from xfstests uses this a lot by calling "truncate64" directly.