package continuityfs

import "github.com/containerd/continuity/continuityfs"

Index

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 driver.Driver) FileContentProvider

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

Source Files

fuse.go provider.go

Version
v0.2.0
Published
Sep 14, 2021
Platform
linux/amd64
Imports
13 packages
Last checked
3 days ago

Tools for package owners.