当前位置: 首页>>代码示例>>Golang>>正文


Golang helpers.DagBuilderParams类代码示例

本文整理汇总了Golang中github.com/ipfs/go-ipfs/importer/helpers.DagBuilderParams的典型用法代码示例。如果您正苦于以下问题:Golang DagBuilderParams类的具体用法?Golang DagBuilderParams怎么用?Golang DagBuilderParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DagBuilderParams类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: BuildDagFromReader

func BuildDagFromReader(ds dag.DAGService, spl chunk.Splitter) (node.Node, error) {
	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
	}

	return bal.BalancedLayout(dbp.New(spl))
}
开发者ID:VictorBjelkholm,项目名称:go-ipfs,代码行数:8,代码来源:importer.go

示例2: BuildTrickleDagFromReader

func BuildTrickleDagFromReader(ds dag.DAGService, spl chunk.Splitter) (*dag.Node, error) {
	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
	}

	return trickle.TrickleLayout(dbp.New(spl))
}
开发者ID:musha68k,项目名称:go-ipfs,代码行数:8,代码来源:importer.go

示例3: buildTestDag

func buildTestDag(ds dag.DAGService, spl chunk.Splitter) (*dag.Node, error) {
	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
	}

	return BalancedLayout(dbp.New(spl))
}
开发者ID:musha68k,项目名称:go-ipfs,代码行数:8,代码来源:balanced_test.go

示例4: buildTestDag

func buildTestDag(ds dag.DAGService, spl chunk.Splitter) (*dag.Node, error) {
	// Start the splitter
	blkch, errs := chunk.Chan(spl)

	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
	}

	return BalancedLayout(dbp.New(blkch, errs))
}
开发者ID:andradeandrey,项目名称:go-ipfs,代码行数:11,代码来源:balanced_test.go

示例5: buildTestDag

func buildTestDag(r io.Reader, ds merkledag.DAGService, spl chunk.BlockSplitter) (*merkledag.Node, error) {
	// Start the splitter
	blkch := spl.Split(r)

	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
	}

	return BalancedLayout(dbp.New(blkch))
}
开发者ID:avbalu,项目名称:go-ipfs,代码行数:11,代码来源:balanced_test.go

示例6: BuildTrickleDagFromReader

func BuildTrickleDagFromReader(ds dag.DAGService, spl chunk.Splitter, ncb h.NodeCB) (*dag.Node, error) {
	// Start the splitter
	blkch, errch := chunk.Chan(spl)

	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
		NodeCB:   ncb,
	}

	return trickle.TrickleLayout(dbp.New(blkch, errch))
}
开发者ID:JeffreyRodriguez,项目名称:go-ipfs,代码行数:12,代码来源:importer.go

示例7: BuildDagFromReader

func BuildDagFromReader(r io.Reader, ds dag.DAGService, spl chunk.BlockSplitter, ncb h.NodeCB) (*dag.Node, error) {
	// Start the splitter
	blkch := spl.Split(r)

	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
		NodeCB:   ncb,
	}

	return bal.BalancedLayout(dbp.New(blkch))
}
开发者ID:avbalu,项目名称:go-ipfs,代码行数:12,代码来源:importer.go

示例8: buildTestDag

func buildTestDag(ds merkledag.DAGService, spl chunk.Splitter) (*merkledag.Node, error) {
	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
	}

	nd, err := TrickleLayout(dbp.New(spl))
	if err != nil {
		return nil, err
	}

	return nd, VerifyTrickleDagStructure(nd, ds, dbp.Maxlinks, layerRepeat)
}
开发者ID:yanghongkjxy,项目名称:go-ipfs,代码行数:13,代码来源:trickle_test.go

示例9: buildTestDag

func buildTestDag(ds dag.DAGService, spl chunk.Splitter) (*dag.ProtoNode, error) {
	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
	}

	nd, err := BalancedLayout(dbp.New(spl))
	if err != nil {
		return nil, err
	}

	return nd.(*dag.ProtoNode), nil
}
开发者ID:qnib,项目名称:go-ipfs,代码行数:13,代码来源:balanced_test.go

示例10: buildTestDag

func buildTestDag(r io.Reader, ds merkledag.DAGService, spl chunk.BlockSplitter) (*merkledag.Node, error) {
	// Start the splitter
	blkch := spl.Split(r)

	dbp := h.DagBuilderParams{
		Dagserv:  ds,
		Maxlinks: h.DefaultLinksPerBlock,
	}

	nd, err := TrickleLayout(dbp.New(blkch))
	if err != nil {
		return nil, err
	}

	return nd, VerifyTrickleDagStructure(nd, ds, dbp.Maxlinks, layerRepeat)
}
开发者ID:avbalu,项目名称:go-ipfs,代码行数:16,代码来源:trickle_test.go

示例11: add

// Perform the actual add & pin locally, outputting results to reader
func (adder Adder) add(reader io.Reader) (node.Node, error) {
	chnk, err := chunk.FromString(reader, adder.Chunker)
	if err != nil {
		return nil, err
	}
	params := ihelper.DagBuilderParams{
		Dagserv:   adder.dagService,
		RawLeaves: adder.RawLeaves,
		Maxlinks:  ihelper.DefaultLinksPerBlock,
	}

	if adder.Trickle {
		return trickle.TrickleLayout(params.New(chnk))
	}

	return balanced.BalancedLayout(params.New(chnk))
}
开发者ID:qnib,项目名称:go-ipfs,代码行数:18,代码来源:add.go


注:本文中的github.com/ipfs/go-ipfs/importer/helpers.DagBuilderParams类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。