Versions in this module Expand all Collapse all v0 v0.0.3 Aug 22, 2018 v0.0.2 Aug 21, 2018 Changes in this version + const OpenReadOnly + const OpenReadWrite + const OpenWriteOnly + var ErrDirExists = errors.New("directory already has entry by that name") + var ErrInvalidChild = errors.New("invalid child node") + var ErrIsDirectory = errors.New("error: is a directory") + var ErrNotExist = errors.New("no such rootfs") + var ErrNotYetImplemented = errors.New("not yet implemented") + func FlushPath(rt *Root, pth string) error + func Mkdir(r *Root, pth string, opts MkdirOpts) error + func Mv(r *Root, src, dst string) error + func PutNode(r *Root, path string, nd ipld.Node) error + type Directory struct + func NewDirectory(ctx context.Context, name string, node ipld.Node, parent childCloser, ...) (*Directory, error) + func (d *Directory) AddChild(name string, nd ipld.Node) error + func (d *Directory) AddUnixFSChild(name string, node ipld.Node) error + func (d *Directory) Child(name string) (FSNode, error) + func (d *Directory) Flush() error + func (d *Directory) ForEachEntry(ctx context.Context, f func(NodeListing) error) error + func (d *Directory) GetCidBuilder() cid.Builder + func (d *Directory) GetNode() (ipld.Node, error) + func (d *Directory) List(ctx context.Context) ([]NodeListing, error) + func (d *Directory) ListNames(ctx context.Context) ([]string, error) + func (d *Directory) Mkdir(name string) (*Directory, error) + func (d *Directory) Path() string + func (d *Directory) SetCidBuilder(b cid.Builder) + func (d *Directory) Type() NodeType + func (d *Directory) Uncache(name string) + func (d *Directory) Unlink(name string) error + type FSNode interface + Flush func() error + GetNode func() (ipld.Node, error) + Type func() NodeType + func DirLookup(d *Directory, pth string) (FSNode, error) + func Lookup(r *Root, path string) (FSNode, error) + type File struct + RawLeaves bool + func NewFile(name string, node ipld.Node, parent childCloser, dserv ipld.DAGService) (*File, error) + func (fi *File) Flush() error + func (fi *File) GetNode() (ipld.Node, error) + func (fi *File) Open(flags int, sync bool) (FileDescriptor, error) + func (fi *File) Size() (int64, error) + func (fi *File) Sync() error + func (fi *File) Type() NodeType + type FileDescriptor interface + CtxReadFull func(context.Context, []byte) (int, error) + Flush func() error + Size func() (int64, error) + Sync func() error + Truncate func(int64) error + type MkdirOpts struct + CidBuilder cid.Builder + Flush bool + Mkparents bool + type NodeListing struct + Hash string + Name string + Size int64 + Type int + type NodeType int + const TDir + const TFile + type PubFunc func(context.Context, *cid.Cid) error + type Republisher struct + Publish chan struct{} + TimeoutLong time.Duration + TimeoutShort time.Duration + func NewRepublisher(ctx context.Context, pf PubFunc, tshort, tlong time.Duration) *Republisher + func (np *Republisher) Run() + func (np *Republisher) Update(c *cid.Cid) + func (p *Republisher) Close() error + func (p *Republisher) WaitPub() + type Root struct + func NewRoot(parent context.Context, ds ipld.DAGService, node *dag.ProtoNode, pf PubFunc) (*Root, error) + func (kr *Root) Close() error + func (kr *Root) Flush() error + func (kr *Root) FlushMemFree(ctx context.Context) error + func (kr *Root) GetDirectory() *Directory