Documentation
¶
Overview ¶
package unixfs/io implements convenience objects for working with the ipfs unixfs data format.
Index ¶
- Variables
- func NewBufDagReader(b []byte) *bufDagReader
- func NewPBFileReader(ctx context.Context, n *mdag.ProtoNode, pb *ftpb.Data, serv mdag.DAGService) *pbDagReader
- func ResolveUnixfsOnce(ctx context.Context, ds dag.DAGService, nd node.Node, names []string) (*node.Link, []string, error)
- type DagReader
- type Directory
- func (d *Directory) AddChild(ctx context.Context, name string, nd node.Node) error
- func (d *Directory) Find(ctx context.Context, name string) (node.Node, error)
- func (d *Directory) ForEachLink(ctx context.Context, f func(*node.Link) error) error
- func (d *Directory) GetNode() (node.Node, error)
- func (d *Directory) GetPrefix() *cid.Prefix
- func (d *Directory) Links(ctx context.Context) ([]*node.Link, error)
- func (d *Directory) RemoveChild(ctx context.Context, name string) error
- func (d *Directory) SetPrefix(prefix *cid.Prefix)
- type ReadSeekCloser
Constants ¶
This section is empty.
Variables ¶
var DefaultShardWidth = 256
DefaultShardWidth is the default value used for hamt sharding width.
ErrNotADir implies that the given node was not a unixfs directory
var ShardSplitThreshold = 1000
ShardSplitThreshold specifies how large of an unsharded directory the Directory code will generate. Adding entries over this value will result in the node being restructured into a sharded object.
var UseHAMTSharding = false
UseHAMTSharding is a global flag that signifies whether or not to use the HAMT sharding scheme for directory creation
Functions ¶
func NewPBFileReader ¶ added in v0.4.5
func ResolveUnixfsOnce ¶ added in v0.4.5
func ResolveUnixfsOnce(ctx context.Context, ds dag.DAGService, nd node.Node, names []string) (*node.Link, []string, error)
ResolveUnixfsOnce resolves a single hop of a path through a graph in a unixfs context. This includes handling traversing sharded directories.
Types ¶
type DagReader ¶
type Directory ¶ added in v0.4.8
type Directory struct {
// contains filtered or unexported fields
}
func NewDirectory ¶
func NewDirectory(dserv mdag.DAGService) *Directory
NewDirectory returns a Directory. It needs a DAGService to add the Children
func NewDirectoryFromNode ¶ added in v0.4.8
func (*Directory) AddChild ¶ added in v0.4.8
AddChild adds a (name, key)-pair to the root node.
func (*Directory) Find ¶ added in v0.4.8
func (*Directory) ForEachLink ¶ added in v0.4.8
func (*Directory) GetNode ¶ added in v0.4.8
GetNode returns the root of this Directory
func (*Directory) GetPrefix ¶ added in v0.4.12
GetPrefix returns the CID Prefix used
func (*Directory) Links ¶ added in v0.4.8
func (*Directory) RemoveChild ¶ added in v0.4.8
Source Files
¶
- bufdagreader.go
- dagreader.go
- dirbuilder.go
- doc.go
- pbdagreader.go
- resolve.go