ipns

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

package fuse/ipns implements a fuse filesystem that interfaces with ipns, the naming system for ipfs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeKeyspace

func InitializeKeyspace(n *core.IpfsNode, key ci.PrivKey) error

InitializeKeyspace sets the ipns record for the given key to point to an empty directory.

func Mount

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

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

Types

type Directory added in v0.3.2

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

Directory is wrapper over an mfs directory to satisfy the fuse fs interface

func (*Directory) Attr added in v0.3.2

func (d *Directory) Attr(ctx context.Context, a *fuse.Attr) error

Attr returns the attributes of a given node.

func (*Directory) Create added in v0.3.2

func (dir *Directory) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fs.Node, fs.Handle, error)

func (*Directory) Lookup added in v0.3.2

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

Lookup performs a lookup under this node.

func (*Directory) Mkdir added in v0.3.2

func (dir *Directory) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, error)

func (*Directory) ReadDirAll added in v0.3.2

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

ReadDirAll reads the link structure as directory entries

func (*Directory) Remove added in v0.3.2

func (dir *Directory) Remove(ctx context.Context, req *fuse.RemoveRequest) error

func (*Directory) Rename added in v0.3.2

func (dir *Directory) Rename(ctx context.Context, req *fuse.RenameRequest, newDir fs.Node) error

Rename implements NodeRenamer

type File added in v0.3.2

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

File is wrapper over an mfs file to satisfy the fuse fs interface

func (*File) Flush added in v0.3.2

func (fi *File) Flush(ctx context.Context, req *fuse.FlushRequest) error

func (*File) Forget added in v0.3.2

func (fi *File) Forget()

func (*File) Read added in v0.3.2

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

func (*File) Release added in v0.3.2

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

func (*File) Setattr added in v0.3.4

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

func (*File) Write added in v0.3.2

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

type FileNode added in v0.4.0

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

func (*FileNode) Attr added in v0.4.0

func (fi *FileNode) Attr(ctx context.Context, a *fuse.Attr) error

Attr returns the attributes of a given node.

func (*FileNode) Fsync added in v0.4.0

func (fi *FileNode) Fsync(ctx context.Context, req *fuse.FsyncRequest) error

Fsync flushes the content in the file to disk, but does not update the dag tree internally

func (*FileNode) Open added in v0.4.0

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

type FileSystem

type FileSystem struct {
	Ipfs     *core.IpfsNode
	RootNode *Root
}

FileSystem is the readwrite IPNS Fuse Filesystem.

func NewFileSystem

func NewFileSystem(ipfs *core.IpfsNode, sk ci.PrivKey, ipfspath, ipnspath string) (*FileSystem, error)

NewFileSystem constructs new fs using given core.IpfsNode instance.

func (*FileSystem) Destroy added in v0.3.2

func (f *FileSystem) Destroy()

func (*FileSystem) Root

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

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

type Link struct {
	Target string
}

func (*Link) Attr

func (l *Link) Attr(ctx context.Context, a *fuse.Attr) error
func (l *Link) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (string, error)

type Root

type Root struct {
	Ipfs *core.IpfsNode
	Keys map[string]ci.PrivKey

	// Used for symlinking into ipfs
	IpfsRoot  string
	IpnsRoot  string
	LocalDirs map[string]fs.Node
	Roots     map[string]*keyRoot

	LocalLinks map[string]*Link
}

Root is the root object of the filesystem tree.

func CreateRoot

func CreateRoot(ipfs *core.IpfsNode, keys map[string]ci.PrivKey, ipfspath, ipnspath string) (*Root, error)

func (*Root) Attr

func (*Root) Attr(ctx context.Context, a *fuse.Attr) error

Attr returns file attributes.

func (*Root) Close added in v0.3.2

func (r *Root) Close() error

func (*Root) Forget added in v0.3.2

func (r *Root) Forget()

Forget is called when the filesystem is unmounted. probably. see comments here: http://godoc.org/bazil.org/fuse/fs#FSDestroyer

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 added in v0.3.2

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

ReadDirAll reads a particular directory. Will show locally available keys as well as a symlink to the peerID key

type WriteAtBuf

type WriteAtBuf interface {
	io.WriterAt
	Bytes() []byte
}

func NewWriterAtFromBytes

func NewWriterAtFromBytes(b []byte) WriteAtBuf

Jump to

Keyboard shortcuts

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