ipns

package
v0.2.2-buildfails Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2015 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const IpnsReadonly = true

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

func (s *Node) Read(req *fuse.ReadRequest, resp *fuse.ReadResponse, intr fs.Intr) fuse.Error

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