ipns

package
v0.0.0-...-e4696f9 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2014 License: MIT Imports: 21 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 Mount

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

Mount mounts an IpfsNode instance at a particular path. It serves until the process receives exit signals (to Unmount).

Types

type FileSystem

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

FileSystem is the readwrite IPNS Fuse Filesystem.

func NewIpns

func NewIpns(ipfs *core.IpfsNode, ipfspath string) (*FileSystem, error)

NewFileSystem constructs new fs using given core.IpfsNode instance.

func (FileSystem) Root

func (f FileSystem) Root() (fs.Node, fuse.Error)

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

type Link struct {
	Target string
}

func (*Link) Attr

func (l *Link) Attr() fuse.Attr
func (l *Link) Readlink(req *fuse.ReadlinkRequest, intr fs.Intr) (string, fuse.Error)

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) Create

func (n *Node) Create(req *fuse.CreateRequest, resp *fuse.CreateResponse, intr fs.Intr) (fs.Node, fs.Handle, fuse.Error)

func (*Node) Flush

func (n *Node) Flush(req *fuse.FlushRequest, intr fs.Intr) fuse.Error

func (*Node) Fsync

func (n *Node) Fsync(req *fuse.FsyncRequest, intr fs.Intr) fuse.Error

func (*Node) Lookup

func (s *Node) Lookup(name string, intr fs.Intr) (fs.Node, fuse.Error)

Lookup performs a lookup under this node.

func (*Node) Mkdir

func (n *Node) Mkdir(req *fuse.MkdirRequest, intr fs.Intr) (fs.Node, fuse.Error)

func (*Node) Mknod

func (n *Node) Mknod(req *fuse.MknodRequest, intr fs.Intr) (fs.Node, fuse.Error)

func (*Node) Open

func (n *Node) Open(req *fuse.OpenRequest, resp *fuse.OpenResponse, intr fs.Intr) (fs.Handle, fuse.Error)

func (*Node) ReadAll

func (s *Node) ReadAll(intr fs.Intr) ([]byte, fuse.Error)

ReadAll reads the object data as file data

func (*Node) ReadDir

func (s *Node) ReadDir(intr fs.Intr) ([]fuse.Dirent, fuse.Error)

ReadDir reads the link structure as directory entries

func (*Node) Remove

func (n *Node) Remove(req *fuse.RemoveRequest, intr fs.Intr) fuse.Error

func (*Node) Rename

func (n *Node) Rename(req *fuse.RenameRequest, newDir fs.Node, intr fs.Intr) fuse.Error

func (*Node) Write

func (n *Node) Write(req *fuse.WriteRequest, resp *fuse.WriteResponse, intr fs.Intr) fuse.Error

type Republisher

type Republisher struct {
	TimeoutLong  time.Duration
	TimeoutShort time.Duration
	Publish      chan struct{}
	// contains filtered or unexported fields
}

func NewRepublisher

func NewRepublisher(n *Node, tshort, tlong time.Duration) *Republisher

func (*Republisher) Run

func (np *Republisher) Run()

type Root

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

	// Used for symlinking into ipfs
	IpfsRoot  string
	LocalDirs map[string]*Node

	LocalLink *Link
}

Root is the root object of the filesystem tree.

func CreateRoot

func CreateRoot(n *core.IpfsNode, keys []ci.PrivKey, ipfsroot string) (*Root, error)

func (*Root) Attr

func (*Root) Attr() fuse.Attr

Attr returns file attributes.

func (*Root) Lookup

func (s *Root) Lookup(name string, intr fs.Intr) (fs.Node, fuse.Error)

Lookup performs a lookup under this node.

func (*Root) ReadDir

func (r *Root) ReadDir(intr fs.Intr) ([]fuse.Dirent, fuse.Error)

ReadDir reads a particular directory. Disallowed for root.

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