Documentation ¶
Index ¶
- Constants
- Variables
- func ArrComp(a, b []byte) error
- func ExtendMetaBytes(existing []byte, extended []byte) []byte
- func GetDAGServ() ipld.DAGService
- func GetDagBuilderParams(dserv ipld.DAGService, opts NodeOpts) *h.DagBuilderParams
- func GetEmptyNode(t testing.TB, dserv ipld.DAGService, opts NodeOpts) ipld.Node
- func GetNode(t testing.TB, dserv ipld.DAGService, data []byte, opts NodeOpts) ipld.Node
- func GetNodeWithGivenData(t testing.TB, dserv ipld.DAGService, data []byte, opts NodeOpts) ipld.Node
- func GetRandomNode(t testing.TB, dserv ipld.DAGService, size int64, opts NodeOpts) ([]byte, ipld.Node)
- func GetReedSolomonShards(t *testing.T, inbuf []byte, numData, numParity uint64) [][]byte
- func MetaSplitterGen(size int64) chunker.SplitterGen
- func PrintDag(nd *mdag.ProtoNode, ds ipld.DAGService, indent int)
- func RandomRemoveNodes(t *testing.T, ctx context.Context, root ipld.Node, dserv ipld.DAGService, ...) (ipld.Node, []cid.Cid, []int)
- func ReedSolomonMetaBytes(numData, numParity, fileSize uint64) []byte
- func SizeSplitterGen(size int64) chunker.SplitterGen
- type NodeOpts
Constants ¶
View Source
const ( TestRsDefaultNumData = 10 TestRsDefaultNumParity = 20 )
Variables ¶
View Source
var ( UseProtoBufLeaves = NodeOpts{Prefix: mdag.V0CidPrefix()} UseRawLeaves = NodeOpts{Prefix: mdag.V0CidPrefix(), ForceRawLeaves: true, RawLeavesUsed: true} UseCidV1 = NodeOpts{Prefix: mdag.V1CidPrefix(), RawLeavesUsed: true} UseBlake2b256 NodeOpts )
Some shorthands for NodeOpts.
Functions ¶
func ExtendMetaBytes ¶ added in v0.4.6
func GetDagBuilderParams ¶ added in v0.4.9
func GetDagBuilderParams(dserv ipld.DAGService, opts NodeOpts) *h.DagBuilderParams
func GetEmptyNode ¶
GetEmptyNode returns an empty unixfs file node.
func GetNodeWithGivenData ¶ added in v0.4.9
func GetRandomNode ¶
func GetRandomNode(t testing.TB, dserv ipld.DAGService, size int64, opts NodeOpts) ([]byte, ipld.Node)
GetRandomNode returns a random unixfs file node.
func GetReedSolomonShards ¶ added in v0.5.1
GetReedSolomonShards gets the shards from the original file
func MetaSplitterGen ¶ added in v0.4.6
func MetaSplitterGen(size int64) chunker.SplitterGen
func PrintDag ¶
func PrintDag(nd *mdag.ProtoNode, ds ipld.DAGService, indent int)
PrintDag pretty-prints the given dag to stdout.
func RandomRemoveNodes ¶ added in v0.5.1
func RandomRemoveNodes(t *testing.T, ctx context.Context, root ipld.Node, dserv ipld.DAGService, n int) (ipld.Node, []cid.Cid, []int)
RandomRemoveNodes randomly removes n sharded nodes from under the file root Can remove from 1-n nodes since rand can repeat index Returns shard root node, the list of removed hashes and indices in the original links
func ReedSolomonMetaBytes ¶ added in v0.4.6
func SizeSplitterGen ¶
func SizeSplitterGen(size int64) chunker.SplitterGen
SizeSplitterGen creates a generator.
Types ¶
type NodeOpts ¶
type NodeOpts struct { Prefix cid.Prefix // ForceRawLeaves if true will force the use of raw leaves ForceRawLeaves bool // RawLeavesUsed is true if raw leaves or either implicitly or explicitly enabled RawLeavesUsed bool // Enables reed solomon splitter ReedSolomonEnabled bool // Enables balanced DAG to be used than trickle. Balanced bool Metadata []byte ChunkSize uint64 MaxLinks int MetadataToMdify []byte // contains filtered or unexported fields }
NodeOpts is used by GetNode, GetEmptyNode and GetRandomNode
func UseBalancedWithMetadata ¶ added in v0.4.5
func UseReedSolomon ¶ added in v0.4.4
Click to show internal directories.
Click to hide internal directories.