openconfig / ygnmi

A Go gNMI client library based on ygot-generated code
Apache License 2.0
12 stars 4 forks source link

Proposal: Generate `Map` method for all keyed lists. #100

Closed wenovus closed 1 year ago

wenovus commented 1 year ago

See comment I sent offline for more details. This would mean that for all lists in compressed generation, that this method would be generated. For atomic lists the path simply ends here.

The benefits are (for compressed generation only),

  1. Allows querying just the whole list without using batch.
  2. Allows replacing on the whole list rather than one element at a time.
greg-dennis commented 1 year ago

Should the suffix be "Map" instead of "All"? That "Any" means "return a slice" and "All" means "return a map" seems a little cryptic to me. What do you think?

wenovus commented 1 year ago

Should the suffix be "Map" instead of "All"? That "Any" means "return a slice" and "All" means "return a map" seems a little cryptic to me. What do you think?

I like it. I'll use Map.

DanG100 commented 1 year ago

agreed on Map to prevent confusing Any with All

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 5351171312


Totals Coverage Status
Change from base Build 5351167516: 0.0%
Covered Lines: 1736
Relevant Lines: 2068

💛 - Coveralls