fuseadapter

package
v0.0.0-...-0febee4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errno

func Errno(err error) syscall.Errno

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

func New

func New(core Core, clientID []byte, opts ...Option) *Adapter

func (*Adapter) Close

func (a *Adapter) Close()

func (*Adapter) Create

func (a *Adapter) Create(
	ctx context.Context,
	parent uint64,
	name []byte,
	opts filesystem.CreateOptions,
) (filesystem.CreateResult, syscall.Errno)

func (*Adapter) FileLock

func (*Adapter) FileLock(context.Context) syscall.Errno

func (*Adapter) Flush

func (a *Adapter) Flush(ctx context.Context, inode uint64, fh uint64) syscall.Errno

func (*Adapter) Fsync

func (a *Adapter) Fsync(ctx context.Context, inode uint64, fh uint64, datasync bool) syscall.Errno

func (*Adapter) GetAttr

func (a *Adapter) GetAttr(ctx context.Context, inode uint64) (filesystem.Stat, syscall.Errno)

func (*Adapter) Lookup

func (a *Adapter) Lookup(ctx context.Context, parent uint64, name []byte) (filesystem.Stat, syscall.Errno)

func (*Adapter) Mkdir

func (a *Adapter) Mkdir(
	ctx context.Context,
	parent uint64,
	name []byte,
	opts filesystem.CreateOptions,
) (filesystem.CreateResult, syscall.Errno)

func (*Adapter) Mknod

func (a *Adapter) Mknod(
	ctx context.Context,
	parent uint64,
	name []byte,
	opts filesystem.CreateOptions,
) (filesystem.CreateResult, syscall.Errno)

func (*Adapter) Open

func (a *Adapter) Open(ctx context.Context, inode uint64) (uint64, syscall.Errno)

func (*Adapter) Read

func (a *Adapter) Read(ctx context.Context, inode uint64, fh uint64, offset uint64, size uint64) ([]byte, syscall.Errno)

func (*Adapter) Readdir

func (a *Adapter) Readdir(ctx context.Context, inode uint64, cookie string) (filesystem.ReaddirResult, syscall.Errno)
func (*Adapter) Readlink(context.Context) syscall.Errno

func (*Adapter) Release

func (a *Adapter) Release(ctx context.Context, inode uint64, fh uint64) syscall.Errno

func (*Adapter) Rename

func (a *Adapter) Rename(
	ctx context.Context,
	oldParent uint64,
	oldName []byte,
	newParent uint64,
	newName []byte,
) syscall.Errno

func (*Adapter) Rmdir

func (a *Adapter) Rmdir(ctx context.Context, parent uint64, name []byte) syscall.Errno

func (*Adapter) SetAttr

func (a *Adapter) SetAttr(
	ctx context.Context,
	inode uint64,
	mask filesystem.SetAttrMask,
	attrs filesystem.SetAttr,
) (filesystem.Stat, syscall.Errno)

func (*Adapter) StatFS

func (a *Adapter) StatFS(ctx context.Context, inode uint64) (filesystem.StatFS, syscall.Errno)
func (*Adapter) Symlink(context.Context) syscall.Errno
func (a *Adapter) Unlink(ctx context.Context, parent uint64, name []byte) syscall.Errno

func (*Adapter) Write

func (a *Adapter) Write(ctx context.Context, inode uint64, fh uint64, offset uint64, data []byte) (int, syscall.Errno)

type Option

type Option func(*Adapter)

func WithHandleKeepaliveInterval

func WithHandleKeepaliveInterval(interval time.Duration) Option

func WithHandleKeepaliveTimeout

func WithHandleKeepaliveTimeout(timeout time.Duration) Option

func WithReaddirLimit

func WithReaddirLimit(limit int) Option

type RawFileSystem

type RawFileSystem struct {
	fuse.RawFileSystem
	// contains filtered or unexported fields
}

RawFileSystem binds the protocol-neutral adapter to go-fuse's wire API. Embedding the default implementation keeps out-of-scope operations explicit: go-fuse returns ENOSYS unless this type overrides the operation below.

func NewRawFileSystem

func NewRawFileSystem(adapter *Adapter) *RawFileSystem

NewRawFileSystem creates the request bridge without mounting it. Tests and embedders can exercise this surface directly; Mount performs the kernel bind.

func (*RawFileSystem) Access

func (r *RawFileSystem) Access(cancel <-chan struct{}, input *fuse.AccessIn) fuse.Status

func (*RawFileSystem) Create

func (r *RawFileSystem) Create(cancel <-chan struct{}, input *fuse.CreateIn, name string, out *fuse.CreateOut) fuse.Status

func (*RawFileSystem) Flush

func (r *RawFileSystem) Flush(cancel <-chan struct{}, input *fuse.FlushIn) fuse.Status

func (*RawFileSystem) Fsync

func (r *RawFileSystem) Fsync(cancel <-chan struct{}, input *fuse.FsyncIn) fuse.Status

func (*RawFileSystem) FsyncDir

func (r *RawFileSystem) FsyncDir(<-chan struct{}, *fuse.FsyncIn) fuse.Status

func (*RawFileSystem) GetAttr

func (r *RawFileSystem) GetAttr(cancel <-chan struct{}, input *fuse.GetAttrIn, out *fuse.AttrOut) fuse.Status
func (r *RawFileSystem) Link(<-chan struct{}, *fuse.LinkIn, string, *fuse.EntryOut) fuse.Status

func (*RawFileSystem) Lookup

func (r *RawFileSystem) Lookup(cancel <-chan struct{}, header *fuse.InHeader, name string, out *fuse.EntryOut) fuse.Status

func (*RawFileSystem) Mkdir

func (r *RawFileSystem) Mkdir(cancel <-chan struct{}, input *fuse.MkdirIn, name string, out *fuse.EntryOut) fuse.Status

func (*RawFileSystem) Mknod

func (r *RawFileSystem) Mknod(cancel <-chan struct{}, input *fuse.MknodIn, name string, out *fuse.EntryOut) fuse.Status

func (*RawFileSystem) Open

func (r *RawFileSystem) Open(cancel <-chan struct{}, input *fuse.OpenIn, out *fuse.OpenOut) fuse.Status

func (*RawFileSystem) OpenDir

func (r *RawFileSystem) OpenDir(cancel <-chan struct{}, input *fuse.OpenIn, out *fuse.OpenOut) fuse.Status

func (*RawFileSystem) Read

func (r *RawFileSystem) Read(cancel <-chan struct{}, input *fuse.ReadIn, _ []byte) (fuse.ReadResult, fuse.Status)

func (*RawFileSystem) ReadDir

func (r *RawFileSystem) ReadDir(cancel <-chan struct{}, input *fuse.ReadIn, out *fuse.DirEntryList) fuse.Status
func (r *RawFileSystem) Readlink(<-chan struct{}, *fuse.InHeader) ([]byte, fuse.Status)

func (*RawFileSystem) Release

func (r *RawFileSystem) Release(cancel <-chan struct{}, input *fuse.ReleaseIn)

func (*RawFileSystem) ReleaseDir

func (r *RawFileSystem) ReleaseDir(input *fuse.ReleaseIn)

func (*RawFileSystem) Rename

func (r *RawFileSystem) Rename(cancel <-chan struct{}, input *fuse.RenameIn, oldName string, newName string) fuse.Status

func (*RawFileSystem) Rmdir

func (r *RawFileSystem) Rmdir(cancel <-chan struct{}, header *fuse.InHeader, name string) fuse.Status

func (*RawFileSystem) SetAttr

func (r *RawFileSystem) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse.AttrOut) fuse.Status

func (*RawFileSystem) StatFs

func (r *RawFileSystem) StatFs(cancel <-chan struct{}, input *fuse.InHeader, out *fuse.StatfsOut) fuse.Status

func (*RawFileSystem) String

func (r *RawFileSystem) String() string
func (r *RawFileSystem) Symlink(<-chan struct{}, *fuse.InHeader, string, string, *fuse.EntryOut) fuse.Status
func (r *RawFileSystem) Unlink(cancel <-chan struct{}, header *fuse.InHeader, name string) fuse.Status

func (*RawFileSystem) Write

func (r *RawFileSystem) Write(cancel <-chan struct{}, input *fuse.WriteIn, data []byte) (uint32, fuse.Status)

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server owns an active kernel mount and its adapter session.

func Mount

func Mount(mountPoint string, adapter *Adapter, options *fuse.MountOptions) (*Server, error)

Mount attaches adapter to mountPoint using go-fuse. The returned server is ready for Serve; callers should call Unmount during shutdown.

func (*Server) Serve

func (s *Server) Serve()

func (*Server) Unmount

func (s *Server) Unmount() error

func (*Server) Wait

func (s *Server) Wait()

func (*Server) WaitMount

func (s *Server) WaitMount() error

Jump to

Keyboard shortcuts

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