Documentation
¶
Overview ¶
Package merkledag is a generated protocol buffer package.
It is generated from these files:
node.proto
It has these top-level messages:
PBLink PBNode
Index ¶
- type DAGService
- type Link
- type Node
- func (n *Node) AddNodeLink(name string, that *Node) error
- func (n *Node) Encoded(force bool) ([]byte, error)
- func (n *Node) Key() (u.Key, error)
- func (n *Node) Marshal() ([]byte, error)
- func (n *Node) MarshalTo(encoded []byte) error
- func (n *Node) Multihash() (mh.Multihash, error)
- func (n *Node) Size() (uint64, error)
- func (n *Node) Unmarshal(encoded []byte) error
- type NodeMap
- type PBLink
- func (this *PBLink) Equal(that interface{}) bool
- func (m *PBLink) GetHash() []byte
- func (m *PBLink) GetName() string
- func (m *PBLink) GetTsize() uint64
- func (this *PBLink) GoString() string
- func (m *PBLink) Marshal() (data []byte, err error)
- func (m *PBLink) MarshalTo(data []byte) (n int, err error)
- func (*PBLink) ProtoMessage()
- func (m *PBLink) Reset()
- func (m *PBLink) Size() (n int)
- func (this *PBLink) String() string
- func (m *PBLink) Unmarshal(data []byte) error
- func (this *PBLink) VerboseEqual(that interface{}) error
- type PBNode
- func (this *PBNode) Equal(that interface{}) bool
- func (m *PBNode) GetData() []byte
- func (m *PBNode) GetLinks() []*PBLink
- func (this *PBNode) GoString() string
- func (m *PBNode) Marshal() (data []byte, err error)
- func (m *PBNode) MarshalTo(data []byte) (n int, err error)
- func (*PBNode) ProtoMessage()
- func (m *PBNode) Reset()
- func (m *PBNode) Size() (n int)
- func (this *PBNode) String() string
- func (m *PBNode) Unmarshal(data []byte) error
- func (this *PBNode) VerboseEqual(that interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAGService ¶
type DAGService struct {
Blocks *blocks.BlockService
}
DAGService is an IPFS Merkle DAG service. - the root is virtual (like a forest) - stores nodes' data in a BlockService
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 Hash mh.Multihash // a ptr to the actual node for graph manipulation Node *Node }
Link represents an IPFS Merkle DAG Link between Nodes.
type Node ¶
Node represents a node in the IPFS Merkle DAG. nodes have opaque data and a set of navigable links.
func (*Node) AddNodeLink ¶
AddNodeLink adds a link to another node.
func (*Node) Encoded ¶
Encoded returns the encoded raw data version of a Node instance. It may use a cached encoded version, unless the force flag is given.
func (*Node) Marshal ¶
Marshal encodes a *Node instance into a new byte slice. The conversion uses an intermediate PBNode.
func (*Node) MarshalTo ¶
MarshalTo encodes a *Node instance into a given byte slice. The conversion uses an intermediate PBNode.
type NodeMap ¶
NodeMap maps u.Keys to Nodes. We cannot use []byte/Multihash for keys :( so have to convert Multihash bytes to string (u.Key)
type PBLink ¶
type PBLink struct { // multihash of the target object Hash []byte `protobuf:"bytes,1,opt" json:"Hash,omitempty"` // utf string name. should be unique per object Name *string `protobuf:"bytes,2,opt" json:"Name,omitempty"` // cumulative size of target object Tsize *uint64 `protobuf:"varint,3,opt" json:"Tsize,omitempty"` XXX_unrecognized []byte `json:"-"` }
An IPFS MerkleDAG Link
func NewPopulatedPBLink ¶
func (*PBLink) ProtoMessage ¶
func (*PBLink) ProtoMessage()
func (*PBLink) VerboseEqual ¶
type PBNode ¶
type PBNode struct { // refs to other objects Links []*PBLink `protobuf:"bytes,2,rep" json:"Links,omitempty"` // opaque user data Data []byte `protobuf:"bytes,1,opt" json:"Data,omitempty"` XXX_unrecognized []byte `json:"-"` }
An IPFS MerkleDAG Node
func NewPopulatedPBNode ¶
func (*PBNode) ProtoMessage ¶
func (*PBNode) ProtoMessage()