qri icon indicating copy to clipboard operation
qri copied to clipboard

unify parameters on lib methods

Open dustmop opened this issue 4 years ago • 3 comments

From https://github.com/qri-io/qri/issues/1731:

unify params ListParams - struct contains Limit, Offset, All RefParams - struct contains Ref, Filter RefListParams - struct contains ListParams, RefParams Audit 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.

dustmop avatar Apr 01 '21 18:04 dustmop

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?

ramfox avatar Apr 02 '21 02:04 ramfox

WIP change to just the field names (not their usages): https://github.com/qri-io/qri/pull/1735

dustmop avatar Apr 02 '21 18:04 dustmop

The first part of this was implemented by https://github.com/qri-io/qri/pull/1754, but ListParams are still TODOs.

dustmop avatar Apr 13 '21 21:04 dustmop