Documentation ¶
Index ¶
- func Bserv() bsrv.BlockService
- func Mock() ipld.DAGService
- type DAGGenerator
- func (dg *DAGGenerator) MakeDagBlock(adder func(ctx context.Context, block blocks.Block) error, fanout uint, ...) (c cid.Cid, allCids []cid.Cid, err error)
- func (dg *DAGGenerator) MakeDagNode(adder func(ctx context.Context, node format.Node) error, fanout uint, ...) (c cid.Cid, allCids []cid.Cid, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DAGGenerator ¶
type DAGGenerator struct {
// contains filtered or unexported fields
}
DAGGenerator generates BasicBlocks on demand. For each instance of DAGGenerator, each new DAG is different from the previous, although two different instances will produce the same, given the same parameters.
func NewDAGGenerator ¶
func NewDAGGenerator() *DAGGenerator
NewDAGGenerator returns an object capable of producing IPLD DAGs.
func (*DAGGenerator) MakeDagBlock ¶
func (dg *DAGGenerator) MakeDagBlock(adder func(ctx context.Context, block blocks.Block) error, fanout uint, depth uint) (c cid.Cid, allCids []cid.Cid, err error)
MakeDagBlock generate a balanced DAG with the given fanout and depth, and add the blocks to the adder. This adder can be for example a blockstore.Put or a blockservice.AddBlock.
func (*DAGGenerator) MakeDagNode ¶
func (dg *DAGGenerator) MakeDagNode(adder func(ctx context.Context, node format.Node) error, fanout uint, depth uint) (c cid.Cid, allCids []cid.Cid, err error)
MakeDagNode generate a balanced DAG with the given fanout and depth, and add the blocks to the adder. This adder can be for example a DAGService.Add.
Click to show internal directories.
Click to hide internal directories.