go-unixfs: github.com/ipfs/go-unixfs/test Index | Files

package testu

import "github.com/ipfs/go-unixfs/test"

Index

Package Files

utils.go

Variables

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.

func ArrComp Uses

func ArrComp(a, b []byte) error

ArrComp checks if two byte slices are the same.

func GetDAGServ Uses

func GetDAGServ() ipld.DAGService

GetDAGServ returns a mock DAGService.

func GetEmptyNode Uses

func GetEmptyNode(t testing.TB, dserv ipld.DAGService, opts NodeOpts) ipld.Node

GetEmptyNode returns an empty unixfs file node.

func GetNode Uses

func GetNode(t testing.TB, dserv ipld.DAGService, data []byte, opts NodeOpts) ipld.Node

GetNode returns a unixfs file node with the specified data.

func GetRandomNode Uses

func GetRandomNode(t testing.TB, dserv ipld.DAGService, size int64, opts NodeOpts) ([]byte, ipld.Node)

GetRandomNode returns a random unixfs file node.

func PrintDag Uses

func PrintDag(nd *mdag.ProtoNode, ds ipld.DAGService, indent int)

PrintDag pretty-prints the given dag to stdout.

func SizeSplitterGen Uses

func SizeSplitterGen(size int64) chunker.SplitterGen

SizeSplitterGen creates a generator.

type NodeOpts Uses

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
}

NodeOpts is used by GetNode, GetEmptyNode and GetRandomNode

Package testu imports 16 packages (graph). Updated 2019-02-25. Refresh now. Tools for package owners.