ipfs / go-unixfsnode

An ADL IPLD prime node that wraps go-codec-dagpb's implementation of protobuf to enable pathing
Other
11 stars 5 forks source link

More extensible and configurable test data generator interface #49

Open rvagg opened 1 year ago

rvagg commented 1 year ago

Came up here while I was considering adding yet another option to the testutil Generate* functions. I can imagine the number of options increasing as use cases expand, and I don't want to keep on adding arguments and breaking API.

We could wind back and add an Options pattern but I think I'd like to go with a more fluent style API to build a configuration and then execute it:

data := unixfs.Dir(t, lsys).
    TargetSize(1<<20).
    Sharded().
    NoDuplicates().
    Generate()