qri
qri copied to clipboard
unify parameters on lib methods
From https://github.com/qri-io/qri/issues/1731:
unify params
ListParams- struct containsLimit,Offset,AllRefParams- struct containsRef,FilterRefListParams- struct containsListParams,RefParamsAudit ALL lib method params, have them extend the above if they can
I did some work on this a few weeks ago, but not enough to push anything. The low hanging fruit are things like changing Refstr to Ref everywhere, and changing Selector to Component. There may be a few cases where we can merge params structs, like was possible with fsi (many similar structs all got combined into LinkParams, see https://github.com/qri-io/qri/commit/afaf06d38dced4517cbdb0c5d07e06b2ccc8944f). The two big difficult parts, no surprise, are Get and Save which have large structs with lots of parameters.
Okay so, from what I'm getting, is that our main fields that we need to cover are:
Limit, Offset, Filter, & All - which are things you do to a list... ListParams?
Ref & Component - which are things that indicate some or all of a dataset... RefParams?
Both... RefListParams?
And they can be grouped and used by the other params as necessary?
WIP change to just the field names (not their usages): https://github.com/qri-io/qri/pull/1735
The first part of this was implemented by https://github.com/qri-io/qri/pull/1754, but ListParams are still TODOs.