readonly

package
v0.0.0-...-bafe949 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

package fuse/readonly implements a fuse filesystem to access files stored inside of ipfs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(ipfs *core.IpfsNode, mountpoint string) (mount.Mount, error)

Mount mounts ipfs at a given location, and returns a mount.Mount instance.

Types

type FileSystem

type FileSystem struct {
	Ipfs *core.IpfsNode
}

FileSystem is the readonly Ipfs Fuse Filesystem.

func NewFileSystem

func NewFileSystem(ipfs *core.IpfsNode) *FileSystem

NewFileSystem constructs new fs using given core.IpfsNode instance.

func (FileSystem) Root

func (f FileSystem) Root() (fs.Node, error)

Root constructs the Root of the filesystem, a Root object.

type Node

type Node struct {
	Ipfs *core.IpfsNode
	Nd   *mdag.Node
	// contains filtered or unexported fields
}

Node is the core object representing a filesystem tree node.

func (*Node) Attr

func (s *Node) Attr() fuse.Attr

Attr returns the attributes of a given node.

func (*Node) Lookup

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

Lookup performs a lookup under this node.

func (*Node) Read

func (s *Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error

func (*Node) ReadDirAll

func (s *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

ReadDirAll reads the link structure as directory entries

type Root

type Root struct {
	Ipfs *core.IpfsNode
}

Root is the root object of the filesystem tree.

func (*Root) Attr

func (*Root) Attr() fuse.Attr

Attr returns file attributes.

func (*Root) Lookup

func (s *Root) Lookup(ctx context.Context, name string) (fs.Node, error)

Lookup performs a lookup under this node.

func (*Root) ReadDirAll

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

ReadDirAll reads a particular directory. Disallowed for root.

Jump to

Keyboard shortcuts

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