Documentation ¶
Index ¶
- Variables
- func NewFuseServer(path string, mountpoint string, container domain.ContainerIface, ...) domain.FuseServerIface
- type Dir
- func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fs.Node, fs.Handle, error)
- func (d *Dir) Forget()
- func (d *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (fs.Node, error)
- func (d *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, error)
- func (d *Dir) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error)
- func (d *Dir) ReadDirAll(ctx context.Context, req *fuse.ReadRequest) ([]fuse.Dirent, error)
- type File
- func (f *File) Attr(ctx context.Context, a *fuse.Attr) error
- func (f *File) Forget()
- func (f *File) ModTime() time.Time
- func (f *File) Mode() os.FileMode
- func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error)
- func (f *File) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error
- func (f *File) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (string, error)
- func (f *File) Release(ctx context.Context, req *fuse.ReleaseRequest) error
- func (f *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error
- func (f *File) Size() uint64
- func (f *File) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error
- type FuseServerService
- func (fss *FuseServerService) CreateFuseServer(serveCntr, stateCntr domain.ContainerIface) error
- func (fss *FuseServerService) DestroyFuseServer(cntrId string) error
- func (fss *FuseServerService) DestroyFuseService()
- func (fss *FuseServerService) FuseServerCntrRegComplete(cntr domain.ContainerIface) error
- func (fss *FuseServerService) Setup(mp string, css domain.ContainerStateServiceIface, ios domain.IOServiceIface, ...) error
- type IOerror
Constants ¶
This section is empty.
Variables ¶
var AttribCacheTimeout int64 = 0x7fffffffffffffff
Attribute's cache-timeout: This is the maximum amount of time that kernel will hold attributes associated to any given file/dir. Refer to man fuse(4) for details.
var DentryCacheTimeout int64 = 0x7fffffffffffffff
Default dentry-cache-timeout interval: This is the maximum amount of time that VFS will hold on to dentry elements before starting to forward lookup() operations to FUSE server. We want to set this to infinite ideally; we set it to the max allowed value.
Functions ¶
func NewFuseServer ¶
func NewFuseServer( path string, mountpoint string, container domain.ContainerIface, service *FuseServerService) domain.FuseServerIface
Types ¶
type Dir ¶
type Dir struct { // // Underlying File struct representing each directory. // File }
Dir struct serves as a FUSE-friendly abstraction to represent directories present in the host FS.
func NewDir ¶
func NewDir(req *domain.HandlerRequest, attr *fuse.Attr, srv *fuseServer) *Dir
NewDir method serves as Dir constructor.
func (*Dir) Create ¶
func (d *Dir) Create( ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fs.Node, fs.Handle, error)
Create FS operation.
func (*Dir) Lookup ¶
func (d *Dir) Lookup( ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (fs.Node, error)
Lookup FS operation.
func (*Dir) Open ¶
func (d *Dir) Open( ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error)
Open FS operation.
func (*Dir) ReadDirAll ¶
ReadDirAll FS operation.
type File ¶
type File struct {
// contains filtered or unexported fields
}
func NewFile ¶
func NewFile(req *domain.HandlerRequest, attr *fuse.Attr, srv *fuseServer) *File
NewFile method serves as File constructor.
func (*File) Open ¶
func (f *File) Open( ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error)
Open FS operation.
func (*File) Read ¶
func (f *File) Read( ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error
Read FS operation.
func (*File) Setattr ¶
func (f *File) Setattr( ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error
Setattr FS operation.
func (*File) Write ¶
func (f *File) Write( ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error
Write FS operation.
type FuseServerService ¶
type FuseServerService struct { sync.RWMutex // servers map protection // contains filtered or unexported fields }
func NewFuseServerService ¶
func NewFuseServerService() *FuseServerService
FuseServerService constructor.
func (*FuseServerService) CreateFuseServer ¶
func (fss *FuseServerService) CreateFuseServer(serveCntr, stateCntr domain.ContainerIface) error
Creates new fuse-server.
serveCntr is the container on which the fuse server will listen. stateCntr is the container object tracking the state for the fuse accesses.
Normally serveCntr and stateCntr refer to the same cntr object. However, if multiple containers want to share the same fuse state (as sysbox-fs does for kubernetes pods), then this function may be called with different serveCntr objects but the same stateCntr object.
func (*FuseServerService) DestroyFuseServer ¶
func (fss *FuseServerService) DestroyFuseServer(cntrId string) error
Destroy a fuse-server.
func (*FuseServerService) DestroyFuseService ¶
func (fss *FuseServerService) DestroyFuseService()
FuseServerService destructor.
func (*FuseServerService) FuseServerCntrRegComplete ¶
func (fss *FuseServerService) FuseServerCntrRegComplete(cntr domain.ContainerIface) error
func (*FuseServerService) Setup ¶
func (fss *FuseServerService) Setup( mp string, css domain.ContainerStateServiceIface, ios domain.IOServiceIface, hds domain.HandlerServiceIface) error
type IOerror ¶
type IOerror struct { RcvError error `json:"-"` Type string `json:"type"` Code syscall.Errno `json:"code"` Message string `json:"message"` }
IOerror's purpose is to encapsulate errors to be delivered to FUSE-Bazil library, which imposes certain demands on the error types that can be handled (i.e. it must satisfy 'errorNumber' interface).
As part of this 'error' implementation, we are also providing an encoding specialization method to the (un)marshalling routines involved in 'nsenter' processing events. Note that without this specialization, we wouldn't be able to encode generic 'error' interface types; which is precisely the reason that the 'RcvError' member below is not being exposed to JSON marshalling logic.
func (IOerror) Errno ¶
Method requested by fuse.ErrorNumber interface. By implementing this interface, we are allowed to return IOerrors back to our FUSE-lib modules without making any modification to Bazil-FUSE code.
func (*IOerror) MarshalJSON ¶
MarshallJSON's interface specialization to allow a customized encoding of IOerror struct.