Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct {
// utf string name. should be unique per object
Name string // utf8
// cumulative size of target object
Size uint64
// multihash of the target object
Cid *cid.Cid
}
Link represents an IPFS Merkle DAG Link between Nodes.
type Node ¶
type Node interface {
// Resolve resolves a path through this node, stopping at any link boundary
// and returning the object found as well as the remaining path to traverse
Resolve(path []string) (interface{}, []string, error)
// Tree lists all paths within the object under 'path', and up to the given depth.
// To list the entire object (similar to `find .`) pass "" and -1
Tree(path string, depth int) []string
// ResolveLink is a helper function that calls resolve and asserts the
// output is a link
ResolveLink(path []string) (*Link, []string, error)
Cid() *cid.Cid
// Copy returns a deep copy of this node
Copy() Node
// Links is a helper function that returns all links within this object
Links() []*Link
// TODO: not sure if stat deserves to stay
Stat() (*NodeStat, error)
// Size returns the size in bytes of the serialized object
Size() (uint64, error)
// RawData marshals the node and returns the marshaled bytes
RawData() []byte
String() string
Loggable() map[string]interface{}
}
type NodeStat ¶
type NodeStat struct {
Hash string
NumLinks int // number of links in link table
BlockSize int // size of the raw, encoded data
LinksSize int // size of the links segment
DataSize int // size of the data segment
CumulativeSize int // cumulative size of object and its references
}
NodeStat is a statistics object for a Node. Mostly sizes.
Click to show internal directories.
Click to hide internal directories.