continuityfs

package
v0.0.0-...-1530f13 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFSFromManifest

func NewFSFromManifest(manifest *continuity.Manifest, mountRoot string, provider FileContentProvider) (fs.FS, error)

NewFSFromManifest creates a fuse filesystem using the given manifest to create the node tree and the content provider to serve up content for regular files.

Types

type Dir

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

Dir represents a file system directory

func NewDir

func NewDir(inode uint64, provider FileContentProvider) *Dir

NewDir creates a new directory object

func (*Dir) Attr

func (d *Dir) Attr(ctx context.Context, attr *fuse.Attr) (err error)

Attr sets the fuse attributes for the directory

func (*Dir) Lookup

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

Lookup looks up the filesystem node for the name within the directory

func (*Dir) ReadDirAll

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

ReadDirAll reads all the directory entries

type File

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

File represents any file type (non directory) in the filesystem

func NewFile

func NewFile(inode uint64, provider FileContentProvider) *File

NewFile creates a new file with the given inode and content provider

func (*File) Attr

func (f *File) Attr(ctx context.Context, attr *fuse.Attr) (err error)

Attr sets the fuse attribute for the file

func (*File) Open

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

Open opens the file for read currently only regular files can be opened

type FileContentProvider

type FileContentProvider interface {
	Path(string, digest.Digest) (string, error)
	Open(string, digest.Digest) (io.ReadCloser, error)
}

FileContentProvider is an object which is used to fetch data and inode information about a path or digest. TODO(dmcgowan): Update GetContentPath to provide a filehandle or ReadWriteCloser.

func NewFSFileContentProvider

func NewFSFileContentProvider(root string, driver continuity.Driver) FileContentProvider

NewFSFileContentProvider creates a new content provider which gets content from a directory on an existing filesystem based on the resource path.

Jump to

Keyboard shortcuts

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