Documentation ¶
Overview ¶
Package libfuse defines the component that interacts with the FUSE filesystem and defines all functions to interface with FUSE.
Index ¶
- func NewLibfuseComponent() internal.Component
- type CgofuseFS
- func (cf *CgofuseFS) Access(path string, mask uint32) int
- func (cf *CgofuseFS) Chmod(path string, mode uint32) int
- func (cf *CgofuseFS) Chown(path string, uid uint32, gid uint32) int
- func (cf *CgofuseFS) Create(path string, flags int, mode uint32) (int, uint64)
- func (cf *CgofuseFS) Destroy()
- func (cf *CgofuseFS) Flush(path string, fh uint64) int
- func (cf *CgofuseFS) Fsync(path string, datasync bool, fh uint64) int
- func (cf *CgofuseFS) Fsyncdir(path string, datasync bool, fh uint64) int
- func (cf *CgofuseFS) Getattr(path string, stat *fuse.Stat_t, fh uint64) int
- func (cf *CgofuseFS) Getxattr(path string, name string) (int, []byte)
- func (cf *CgofuseFS) Init()
- func (cf *CgofuseFS) Link(oldpath string, newpath string) int
- func (cf *CgofuseFS) Listxattr(path string, fill func(name string) bool) int
- func (cf *CgofuseFS) Mkdir(path string, mode uint32) int
- func (cf *CgofuseFS) Mknod(path string, mode uint32, dev uint64) int
- func (cf *CgofuseFS) Open(path string, flags int) (int, uint64)
- func (cf *CgofuseFS) Opendir(path string) (int, uint64)
- func (cf *CgofuseFS) Read(path string, buff []byte, ofst int64, fh uint64) int
- func (cf *CgofuseFS) Readdir(path string, fill func(name string, stat *fuse.Stat_t, ofst int64) bool, ...) int
- func (cf *CgofuseFS) Readlink(path string) (int, string)
- func (cf *CgofuseFS) Release(path string, fh uint64) int
- func (cf *CgofuseFS) Releasedir(path string, fh uint64) int
- func (cf *CgofuseFS) Removexattr(path string, name string) int
- func (cf *CgofuseFS) Rename(oldpath string, newpath string) int
- func (cf *CgofuseFS) Rmdir(path string) int
- func (cf *CgofuseFS) Setxattr(path string, name string, value []byte, flags int) int
- func (cf *CgofuseFS) Statfs(path string, stat *fuse.Statfs_t) int
- func (cf *CgofuseFS) Symlink(target string, newpath string) int
- func (cf *CgofuseFS) Truncate(path string, size int64, fh uint64) int
- func (cf *CgofuseFS) Unlink(path string) int
- func (cf *CgofuseFS) Utimens(path string, tmsp []fuse.Timespec) int
- func (cf *CgofuseFS) Write(path string, buff []byte, ofst int64, fh uint64) int
- type Libfuse
- func (lf *Libfuse) Configure(_ bool) error
- func (lf *Libfuse) Name() string
- func (lf *Libfuse) Priority() internal.ComponentPriority
- func (lf *Libfuse) SetName(name string)
- func (lf *Libfuse) SetNextComponent(nc internal.Component)
- func (lf *Libfuse) Start(ctx context.Context) error
- func (lf *Libfuse) Stop() error
- func (lf *Libfuse) Validate(opt *LibfuseOptions) error
- type LibfuseOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLibfuseComponent ¶
Pipeline will call this method to create your object, initialize your variables here << DO NOT DELETE ANY AUTO GENERATED CODE HERE >>
Types ¶
type CgofuseFS ¶
type CgofuseFS struct { // Implement the interface from cgofuse fuse.FileSystemBase // contains filtered or unexported fields }
CgofuseFS defines the file system with functions that interface with FUSE.
func NewcgofuseFS ¶
func NewcgofuseFS() *CgofuseFS
NewcgofuseFS creates a new empty fuse filesystem.
func (*CgofuseFS) Getattr ¶
Getattr retrieves the file attributes at the path and fills them in stat.
func (*CgofuseFS) Init ¶
func (cf *CgofuseFS) Init()
Init notifies the parent process once the mount is successful.
func (*CgofuseFS) Readdir ¶
func (cf *CgofuseFS) Readdir(path string, fill func(name string, stat *fuse.Stat_t, ofst int64) bool, ofst int64, fh uint64) int
Readdir reads a directory at the path.
func (*CgofuseFS) Releasedir ¶
Releasedir opens the handle for the directory at the path.
func (*CgofuseFS) Removexattr ¶
Removexattr is not implemented.
func (*CgofuseFS) Rename ¶
Rename renames a file. https://man7.org/linux/man-pages/man2/rename.2.html errors handled: EISDIR, ENOENT, ENOTDIR, ENOTEMPTY, EEXIST TODO: handle EACCESS, EINVAL?
type Libfuse ¶
type Libfuse struct { internal.BaseComponent // contains filtered or unexported fields }
Libfuse holds the settings and information for the FUSE component.
func (*Libfuse) Configure ¶
Configure : Pipeline will call this method after constructor so that you can read config and initialize yourself
Return failure if any config is not valid to exit the process
func (*Libfuse) Priority ¶
func (lf *Libfuse) Priority() internal.ComponentPriority
func (*Libfuse) SetNextComponent ¶
SetNextComponent sets the next component in the pipeline.
func (*Libfuse) Start ¶
Start : Pipeline calls this method to start the component functionality
this shall not block the call otherwise pipeline will not start
func (*Libfuse) Validate ¶
func (lf *Libfuse) Validate(opt *LibfuseOptions) error
Validate : Validate available config and convert them if required
type LibfuseOptions ¶
type LibfuseOptions struct { DefaultPermission uint32 `config:"default-permission" yaml:"default-permission,omitempty"` AttributeExpiration uint32 `config:"attribute-expiration-sec" yaml:"attribute-expiration-sec,omitempty"` EntryExpiration uint32 `config:"entry-expiration-sec" yaml:"entry-expiration-sec,omitempty"` NegativeEntryExpiration uint32 `config:"negative-entry-expiration-sec" yaml:"negative-entry-expiration-sec,omitempty"` EnableFuseTrace bool `config:"fuse-trace" yaml:"fuse-trace,omitempty"` ExtensionPath string `config:"extension" yaml:"extension,omitempty"` DisableWritebackCache bool `config:"disable-writeback-cache" yaml:"-"` IgnoreOpenFlags bool `config:"ignore-open-flags" yaml:"ignore-open-flags,omitempty"` Uid uint32 `config:"uid" yaml:"uid,omitempty"` Gid uint32 `config:"gid" yaml:"gid,omitempty"` MaxFuseThreads uint32 `config:"max-fuse-threads" yaml:"max-fuse-threads,omitempty"` DirectIO bool `config:"direct-io" yaml:"direct-io,omitempty"` Umask uint32 `config:"umask" yaml:"umask,omitempty"` DisplayCapacityMb uint64 `config:"display-capacity-mb" yaml:"display-capacity-mb,omitempty"` // contains filtered or unexported fields }
LibfuseOptions defines the config parameters.