ipns

package
v0.41.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 23 Imported by: 0

Documentation

Overview

Package ipns implements a FUSE filesystem that interfaces with IPNS, the naming system for IPFS. Only names for which the node holds private keys are writable; all other names resolve to read-only symlinks pointing at the /ipfs mount.

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) (fusemnt.Mount, error)

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

Types

type Link struct {
	fs.Inode
	Target string
}

func (*Link) Getattr

func (l *Link) Getattr(_ context.Context, _ fs.FileHandle, out *fuse.AttrOut) syscall.Errno
func (l *Link) Readlink(_ context.Context) ([]byte, syscall.Errno)

type Root

type Root struct {
	fs.Inode
	Ipfs iface.CoreAPI
	Keys map[string]iface.Key

	// Used for symlinking into ipfs
	IpfsRoot  string
	IpnsRoot  string
	LocalDirs map[string]*writable.Dir
	Roots     map[string]*mfs.Root

	LocalLinks map[string]*Link
	RepoPath   string
}

Root is the root object of the /ipns filesystem tree.

func CreateRoot

func CreateRoot(ctx context.Context, ipfs iface.CoreAPI, keys map[string]iface.Key, ipfspath, ipnspath, repoPath string, mountsCfg config.Mounts, imp config.Import, mfsOpts ...mfs.Option) (*Root, error)

CreateRoot creates the IPNS FUSE root with one writable directory per key.

func (*Root) Close added in v0.3.2

func (r *Root) Close() error

func (*Root) Getattr

func (r *Root) Getattr(_ context.Context, _ fs.FileHandle, out *fuse.AttrOut) syscall.Errno

Getattr returns the root directory attributes.

func (*Root) Lookup

func (r *Root) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*Root) Readdir

func (r *Root) Readdir(_ context.Context) (fs.DirStream, syscall.Errno)

func (*Root) Statfs

func (r *Root) Statfs(_ context.Context, out *fuse.StatfsOut) syscall.Errno

Statfs reports disk-space statistics for the underlying filesystem. macOS Finder checks free space before copying; without this it reports "not enough free space" because go-fuse returns zeroed stats.

Jump to

Keyboard shortcuts

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