ipns

package
v0.0.0-...-7fe9760 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

package fuse/ipns实现了一个fuse文件系统,该文件系统与 有了IPN,IPF的命名系统。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeKeyspace

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

InitializeKeyspace将给定密钥的IPN记录设置为 指向空目录。

func Mount

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

mount在给定位置安装IPN,并返回mount.mount实例。

Types

type Directory

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

目录是对mfs目录的包装,以满足fuse fs接口

func (*Directory) Attr

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

ATTR返回给定节点的属性。

func (*Directory) Create

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

func (*Directory) Lookup

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

查找在此节点下执行查找。

func (*Directory) Mkdir

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

func (*Directory) ReadDirAll

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

readdirall将链接结构作为目录项读取

func (*Directory) Remove

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

func (*Directory) Rename

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

rename实现noderenamer

type File

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

文件是对mfs文件的包装,以满足fuse fs接口

func (*File) Flush

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

func (*File) Forget

func (fi *File) Forget()

func (*File) Read

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

func (*File) Release

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

func (*File) Setattr

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

func (*File) Write

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

type FileNode

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

func (*FileNode) Attr

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

ATTR返回给定节点的属性。

func (*FileNode) Fsync

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

fsync将文件中的内容刷新到磁盘。

func (*FileNode) Open

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是readwrite ipns fuse文件系统。

func NewFileSystem

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

newfilesystem使用给定的core.ipfsnode实例构造新的fs。

func (*FileSystem) Destroy

func (f *FileSystem) Destroy()

func (*FileSystem) Root

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

根构造文件系统的根,根对象。

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

	//用于与IPF的符号链接
	IpfsRoot  string
	IpnsRoot  string
	LocalDirs map[string]fs.Node
	Roots     map[string]*keyRoot

	LocalLinks map[string]*Link
}

根是文件系统树的根对象。

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返回文件属性。

func (*Root) Close

func (r *Root) Close() error

func (*Root) Forget

func (r *Root) Forget()

当卸载文件系统时调用forget。可能。 参见评论:http://godoc.org/bazil.org/fuse/fsdestroyer

func (*Root) Lookup

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

查找在此节点下执行查找。

func (*Root) ReadDirAll

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

readdirall读取特定目录。将显示本地可用的密钥 以及到对等密钥的符号链接

Jump to

Keyboard shortcuts

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