ipns

package
v0.43.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 24 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

	// Cfg is the writable mounts' shared config. The root uses its inode
	// table so the entries it serves itself are numbered from the same
	// sequence as the files under the key directories.
	Cfg *writable.Config
}

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

func CreateRoot

func CreateRoot(ctx context.Context, ipfs iface.CoreAPI, gcLocker bstore.GCLocker, 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 added in v0.41.0

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

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

func (*Root) Statfs added in v0.41.0

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