Documentation
¶
Index ¶
- func Mount(ctx context.Context, mntDir string, debug bool, metaDataUrl string, ...) (*fuse.Server, error)
- type File
- type FileHandler
- type GitFs
- func (gitFs *GitFs) OpenFile(ctx context.Context, inode metadata.Ino) (FileHandler, error)
- func (gitFs *GitFs) OpenRefFile(ctx context.Context, inode metadata.Ino) (FileHandler, error)
- func (gitFs *GitFs) OpenSymRefFile(ctx context.Context, inode metadata.Ino) (FileHandler, error)
- func (gitFs *GitFs) ReleaseFile(ctx context.Context, inode metadata.Ino) error
- type GitRefNode
- func (node *GitRefNode) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (node *GitRefNode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
- func (node *GitRefNode) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- type GitRefsNode
- func (node *GitRefsNode) Create(ctx context.Context, name string, flags uint32, mode uint32, ...) (inode *fs.Inode, fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
- func (node *GitRefsNode) Link(ctx context.Context, target fs.InodeEmbedder, name string, out *fuse.EntryOut) (newNode *fs.Inode, errno syscall.Errno)
- func (node *GitRefsNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *GitRefsNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *GitRefsNode) Mknod(ctx context.Context, name string, mode uint32, dev uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *GitRefsNode) NewFile(ctx context.Context, ino metadata.Ino, name string, _type uint8) (fs.FileHandle, syscall.Errno)
- func (node *GitRefsNode) NewNode(ino metadata.Ino, name string, _type uint8) fs.InodeEmbedder
- type GitRepoNode
- func (node *GitRepoNode) Create(ctx context.Context, name string, flags uint32, mode uint32, ...) (inode *fs.Inode, fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
- func (node *GitRepoNode) Link(ctx context.Context, target fs.InodeEmbedder, name string, out *fuse.EntryOut) (newNode *fs.Inode, errno syscall.Errno)
- func (node *GitRepoNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *GitRepoNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *GitRepoNode) Mknod(ctx context.Context, name string, mode uint32, dev uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *GitRepoNode) NewFile(ctx context.Context, ino metadata.Ino, name string, _type uint8) (fs.FileHandle, syscall.Errno)
- func (node *GitRepoNode) NewNode(ino metadata.Ino, name string, _type uint8) fs.InodeEmbedder
- type GitSymRefNode
- func (node *GitSymRefNode) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (node *GitSymRefNode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
- func (node *GitSymRefNode) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- type Node
- func (node *Node) Access(ctx context.Context, mask uint32) syscall.Errno
- func (node *Node) Create(ctx context.Context, name string, flags uint32, mode uint32, ...) (inode *fs.Inode, fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
- func (node *Node) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (node *Node) Link(ctx context.Context, target fs.InodeEmbedder, name string, out *fuse.EntryOut) (newNode *fs.Inode, errno syscall.Errno)
- func (node *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *Node) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *Node) Mknod(ctx context.Context, name string, mode uint32, dev uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *Node) NewNode(ino metadata.Ino, name string, _type uint8) fs.InodeEmbedder
- func (node *Node) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
- func (node *Node) Opendir(ctx context.Context) syscall.Errno
- func (node *Node) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)
- func (node *Node) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, ...) syscall.Errno
- func (node *Node) Rmdir(ctx context.Context, name string) syscall.Errno
- func (node *Node) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- func (node *Node) Statfs(ctx context.Context, out *fuse.StatfsOut) syscall.Errno
- func (node *Node) Unlink(ctx context.Context, name string) syscall.Errno
- type RefFile
- type RefFileHandler
- func (fh *RefFileHandler) Flush(ctx context.Context) syscall.Errno
- func (fh *RefFileHandler) Fsync(ctx context.Context, flags uint32) syscall.Errno
- func (fh *RefFileHandler) Getattr(ctx context.Context, out *fuse.AttrOut) syscall.Errno
- func (fh *RefFileHandler) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
- func (fh *RefFileHandler) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- func (fh *RefFileHandler) Write(ctx context.Context, data []byte, off int64) (written uint32, errno syscall.Errno)
- type RegularFile
- func (file *RegularFile) NewFileHandler() FileHandler
- func (file *RegularFile) Ref() int
- func (file *RegularFile) Release(ctx context.Context) error
- func (file *RegularFile) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- func (file *RegularFile) UnRef(release func()) error
- type RegularFileHandler
- func (fh *RegularFileHandler) Flush(ctx context.Context) syscall.Errno
- func (fh *RegularFileHandler) Fsync(ctx context.Context, flags uint32) syscall.Errno
- func (fh *RegularFileHandler) Getattr(ctx context.Context, out *fuse.AttrOut) syscall.Errno
- func (fh *RegularFileHandler) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
- func (fh *RegularFileHandler) Release(ctx context.Context) syscall.Errno
- func (fh *RegularFileHandler) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- func (fh *RegularFileHandler) Write(ctx context.Context, data []byte, off int64) (written uint32, errno syscall.Errno)
- type SymRefFile
- type SymRefFileHandler
- func (fh *SymRefFileHandler) Flush(ctx context.Context) syscall.Errno
- func (fh *SymRefFileHandler) Fsync(ctx context.Context, flags uint32) syscall.Errno
- func (fh *SymRefFileHandler) Getattr(ctx context.Context, out *fuse.AttrOut) syscall.Errno
- func (fh *SymRefFileHandler) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
- func (fh *SymRefFileHandler) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- func (fh *SymRefFileHandler) Write(ctx context.Context, data []byte, off int64) (written uint32, errno syscall.Errno)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileHandler ¶
type FileHandler interface { fs.FileHandle }
type GitFs ¶
type GitFs struct { *Node DefaultDataSource *datasource.DataSource // contains filtered or unexported fields }
func (*GitFs) OpenRefFile ¶
func (*GitFs) OpenSymRefFile ¶
type GitRefNode ¶
type GitRefNode struct {
Node
}
func (*GitRefNode) Getattr ¶
func (node *GitRefNode) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno
Getattr If a file handle is passed, the Getattr() function of the file handle is called, otherwise the metadata is loaded directly from meta driver
func (*GitRefNode) Open ¶
func (node *GitRefNode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
Open a file for read/write...
func (*GitRefNode) Setattr ¶
func (node *GitRefNode) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
Setattr If a file handle is passed, the Setattr() function of the file handle is called, otherwise the metadata is written directly to the metadata on disk.
type GitRefsNode ¶
type GitRefsNode struct {
Node
}
func (*GitRefsNode) Create ¶
func (node *GitRefsNode) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (inode *fs.Inode, fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
Create a file, and create a fuse node for it
func (*GitRefsNode) Link ¶
func (node *GitRefsNode) Link(ctx context.Context, target fs.InodeEmbedder, name string, out *fuse.EntryOut) (newNode *fs.Inode, errno syscall.Errno)
Link hard link a file to another inode
func (*GitRefsNode) Lookup ¶
func (node *GitRefsNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Lookup check file info, and create a fuse node for it
func (*GitRefsNode) Mkdir ¶
func (node *GitRefsNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Mkdir create a directory, and create a fuse node for it
func (*GitRefsNode) Mknod ¶
func (node *GitRefsNode) Mknod(ctx context.Context, name string, mode uint32, dev uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Mknod create a node, and create a fuse node for it
func (*GitRefsNode) NewNode ¶
func (node *GitRefsNode) NewNode(ino metadata.Ino, name string, _type uint8) fs.InodeEmbedder
type GitRepoNode ¶
type GitRepoNode struct {
Node
}
func (*GitRepoNode) Create ¶
func (node *GitRepoNode) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (inode *fs.Inode, fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
Create a file, and create a fuse node for it
func (*GitRepoNode) Link ¶
func (node *GitRepoNode) Link(ctx context.Context, target fs.InodeEmbedder, name string, out *fuse.EntryOut) (newNode *fs.Inode, errno syscall.Errno)
Link hard link a file to another inode
func (*GitRepoNode) Lookup ¶
func (node *GitRepoNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Lookup check file info, and create a fuse node for it
func (*GitRepoNode) Mkdir ¶
func (node *GitRepoNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Mkdir create a directory, and create a fuse node for it
func (*GitRepoNode) Mknod ¶
func (node *GitRepoNode) Mknod(ctx context.Context, name string, mode uint32, dev uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Mknod create a node, and create a fuse node for it
func (*GitRepoNode) NewNode ¶
func (node *GitRepoNode) NewNode(ino metadata.Ino, name string, _type uint8) fs.InodeEmbedder
type GitSymRefNode ¶
type GitSymRefNode struct {
Node
}
func (*GitSymRefNode) Getattr ¶
func (node *GitSymRefNode) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno
Getattr If a file handle is passed, the Getattr() function of the file handle is called, otherwise the metadata is loaded directly from meta driver
func (*GitSymRefNode) Open ¶
func (node *GitSymRefNode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
Open a file for read/write...
func (*GitSymRefNode) Setattr ¶
func (node *GitSymRefNode) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
Setattr If a file handle is passed, the Setattr() function of the file handle is called, otherwise the metadata is written directly to the metadata on disk.
type Node ¶
func (*Node) Access ¶
Access check if node can access a file or directory TODO should we use memattr?
func (*Node) Create ¶
func (node *Node) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (inode *fs.Inode, fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
Create a file, and create a fuse node for it
func (*Node) Getattr ¶
Getattr If a file handle is passed, the Getattr() function of the file handle is called, otherwise the metadata is loaded directly from meta driver
func (*Node) Link ¶
func (node *Node) Link(ctx context.Context, target fs.InodeEmbedder, name string, out *fuse.EntryOut) (newNode *fs.Inode, errno syscall.Errno)
Link hard link a file to another inode
func (*Node) Lookup ¶
func (node *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Lookup check file info, and create a fuse node for it
func (*Node) Mkdir ¶
func (node *Node) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Mkdir create a directory, and create a fuse node for it
func (*Node) Mknod ¶
func (node *Node) Mknod(ctx context.Context, name string, mode uint32, dev uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Mknod create a node, and create a fuse node for it
func (*Node) Open ¶
func (node *Node) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
Open a file for read/write...
func (*Node) Opendir ¶
Opendir open a directory (here we only do a check for directory entry) TODO maybe we should maintenance a open directories in memory?
func (*Node) Rename ¶
func (node *Node) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, flags uint32) syscall.Errno
Rename a file with name to newParent/newName TODO should we use memattr
func (*Node) Setattr ¶
func (node *Node) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
Setattr If a file handle is passed, the Setattr() function of the file handle is called, otherwise the metadata is written directly to the metadata on disk.
type RefFile ¶
type RefFile struct { *datasource.DataSource // contains filtered or unexported fields }
func NewRefFile ¶
func NewRefFile(ctx context.Context, inode metadata.Ino, dataSource *datasource.DataSource, gitFs *GitFs) (*RefFile, error)
func (*RefFile) NewFileHandler ¶
func (file *RefFile) NewFileHandler() FileHandler
type RefFileHandler ¶
type RefFileHandler struct {
// contains filtered or unexported fields
}
func (*RefFileHandler) Flush ¶
func (fh *RefFileHandler) Flush(ctx context.Context) syscall.Errno
Flush will be called when file closed. (maybe called many times) We just do fsync here...
func (*RefFileHandler) Read ¶
func (fh *RefFileHandler) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
Read will read the file data begin at offset to dest, read size no large then dest length
type RegularFile ¶
type RegularFile struct { *datasource.DataSource // contains filtered or unexported fields }
func NewRegularFile ¶
func NewRegularFile(ctx context.Context, inode metadata.Ino, dataSource *datasource.DataSource, gitFs *GitFs) (*RegularFile, error)
func (*RegularFile) NewFileHandler ¶
func (file *RegularFile) NewFileHandler() FileHandler
func (*RegularFile) Ref ¶
func (file *RegularFile) Ref() int
func (*RegularFile) UnRef ¶
func (file *RegularFile) UnRef(release func()) error
type RegularFileHandler ¶
type RegularFileHandler struct {
// contains filtered or unexported fields
}
func (*RegularFileHandler) Flush ¶
func (fh *RegularFileHandler) Flush(ctx context.Context) syscall.Errno
Flush will be called when file closed. (maybe called many times) We just do fsync here...
func (*RegularFileHandler) Read ¶
func (fh *RegularFileHandler) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
Read will read the file data begin at offset to dest, read size no large then dest length
func (*RegularFileHandler) Release ¶
func (fh *RegularFileHandler) Release(ctx context.Context) syscall.Errno
Release file handler release
type SymRefFile ¶
type SymRefFile struct { *datasource.DataSource // contains filtered or unexported fields }
func NewSymRefFile ¶
func NewSymRefFile(ctx context.Context, inode metadata.Ino, dataSource *datasource.DataSource, gitFs *GitFs) (*SymRefFile, error)
func (*SymRefFile) NewFileHandler ¶
func (file *SymRefFile) NewFileHandler() FileHandler
func (*SymRefFile) Ref ¶
func (file *SymRefFile) Ref() int
func (*SymRefFile) UnRef ¶
func (file *SymRefFile) UnRef(release func()) error
type SymRefFileHandler ¶
type SymRefFileHandler struct {
// contains filtered or unexported fields
}
func (*SymRefFileHandler) Flush ¶
func (fh *SymRefFileHandler) Flush(ctx context.Context) syscall.Errno
Flush will be called when file closed. (maybe called many times) We just do fsync here...
func (*SymRefFileHandler) Read ¶
func (fh *SymRefFileHandler) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
Read will read the file data begin at offset to dest, read size no large then dest length