fuse

package
v0.0.0-...-21d6f6e Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

README

Current status

File open response flag, fuse.OpenDirectIO, seems to make hard link work, but it causes git to return bus error.

When not using this flag, git init succeeds, but git commit would fail on invalid object.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(mountpoint string, b Backend) (io.Closer, error)

Mount does not block. It's up to the caller to block by reading on a channel, etc.

func Serve

func Serve(mountpoint string, b Backend, stop <-chan interface{}) error

Blocks and serve requests. Close the stop channel will cause this to return which will along the say unmount the mountpoint and release resources.

func Unmount

func Unmount(mountpoint string) error

Types

type Backend

type Backend interface {
	io.Closer
	DirLike
	View(context.Context, func(Context) error) error
	Update(context.Context, func(Context) error) error
}

func NewMapBackend

func NewMapBackend(m map[string]interface{}) Backend

type Context

type Context interface {
	context.Context
	Dir([]string) (DirLike, error)
}

func NewContext

func NewContext(ctx context.Context, dirLike DirLike) Context

type Dir

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

func (*Dir) Attr

func (d *Dir) Attr(c context.Context, a *fuse.Attr) error

func (*Dir) Create

func (d *Dir) Create(c context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fs.Node, fs.Handle, error)
func (d *Dir) Link(c context.Context, req *fuse.LinkRequest, old fs.Node) (l fs.Node, err error)

func (*Dir) Lookup

func (d *Dir) Lookup(c context.Context, name string) (fs.Node, error)

func (*Dir) Mkdir

func (d *Dir) Mkdir(c context.Context, req *fuse.MkdirRequest) (fs.Node, error)

func (*Dir) ReadDirAll

func (d *Dir) ReadDirAll(c context.Context) ([]fuse.Dirent, error)

func (*Dir) Remove

func (d *Dir) Remove(c context.Context, req *fuse.RemoveRequest) error

func (*Dir) Rename

func (d *Dir) Rename(c context.Context, req *fuse.RenameRequest, newDir fs.Node) error

func (*Dir) Setattr

func (d *Dir) Setattr(c context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error
func (d *Dir) Symlink(c context.Context, req *fuse.SymlinkRequest) (l fs.Node, err error)

type DirLike

type DirLike interface {
	DirMeta() (Meta, error)
	GetDir(name string) (DirLike, error)
	CreateDir(name string) (DirLike, error)
	DeleteDir(name string) error
	Cursor() <-chan Entry
	Create(name string) error
	Meta(name string) (Meta, error)
	Get(name string) (interface{}, error)
	Put(name string, value interface{}) error
	Delete(name string) error
}

type Entry

type Entry struct {
	Name string
	Dir  bool
}

type FS

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

func (*FS) Destroy

func (f *FS) Destroy()

func (*FS) Root

func (f *FS) Root() (fs.Node, error)

type File

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

func (*File) Attr

func (f *File) Attr(c context.Context, a *fuse.Attr) error

func (*File) Flush

func (f *File) Flush(c context.Context, req *fuse.FlushRequest) error

func (*File) Fsync

func (f *File) Fsync(c context.Context, req *fuse.FsyncRequest) error

Here we don't do anything and just handle the request with no error. This is because we have a simple Put semantic that writes all the data in a single call. So there's no flushing or marking a commit.

func (*File) Open

func (f *File) Open(c context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error)

func (*File) Read

func (f *File) Read(c context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error
func (f *File) Readlink(c context.Context, req *fuse.ReadlinkRequest) (target string, err error)

func (*File) Release

func (f *File) Release(ctx context.Context, req *fuse.ReleaseRequest) error

func (*File) Setattr

func (f *File) Setattr(c context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error

func (*File) Write

func (f *File) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error

type Meta

type Meta struct {
	Perm os.FileMode
	Size uint64
	Uid  uint32
	Gid  uint32
}

type SimpleBackend

type SimpleBackend struct {
	DirLike
}

func (*SimpleBackend) Close

func (this *SimpleBackend) Close() error

func (*SimpleBackend) GetContext

func (this *SimpleBackend) GetContext(c context.Context) Context

func (*SimpleBackend) Update

func (this *SimpleBackend) Update(c context.Context, f func(Context) error) error

func (*SimpleBackend) View

func (this *SimpleBackend) View(c context.Context, f func(Context) error) error

Jump to

Keyboard shortcuts

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