fs

package
v0.0.0-...-7d0f62f Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	sync.Map
	Timeout time.Duration
}

type CacheEntry

type CacheEntry struct {
	Directory *mcapi.MCFile
	Files     []mcapi.MCFile
	Reload    bool
	LastLoad  time.Time
}

type MCFSFile

type MCFSFile struct {
}

func (*MCFSFile) Flush

func (f *MCFSFile) Flush(ctx context.Context) syscall.Errno

func (*MCFSFile) Lseek

func (f *MCFSFile) Lseek(ctx context.Context, off uint64, whence uint32) (uint64, syscall.Errno)

func (*MCFSFile) Read

func (f *MCFSFile) Read(ctx context.Context, buf []byte, off int64) (res fuse.ReadResult, errno syscall.Errno)

func (*MCFSFile) Write

func (f *MCFSFile) Write(ctx context.Context, data []byte, off int64) (uint32, syscall.Errno)

type Node

type Node struct {
	fs.Inode

	MCFile *mcapi.MCFile
	// contains filtered or unexported fields
}

func RootNode

func RootNode(mcapi *mcapi.Client) *Node

func (*Node) Create

func (n *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)

func (*Node) Getattr

func (n *Node) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*Node) Lookup

func (n *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*Node) Mkdir

func (n *Node) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

Mkdir will create a directory on the Materials Commons server. TODO: Reflect the created directory in the cached nodes. This will require changing to the cache implementation.

func (*Node) Open

func (n *Node) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)

func (*Node) Readdir

func (n *Node) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)

func (*Node) Rename

func (n *Node) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, flags uint32) syscall.Errno

func (*Node) Rmdir

func (n *Node) Rmdir(ctx context.Context, name string) syscall.Errno
func (n *Node) Unlink(ctx context.Context, name string) syscall.Errno

Jump to

Keyboard shortcuts

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