linksmart / historical-datastore

Lightweight time-series storage on the Edge of IoT
Apache License 2.0
13 stars 2 forks source link

Using enum type for "denormalize" query parameter #87

Closed farshidtz closed 4 years ago

farshidtz commented 4 years ago

https://github.com/linksmart/historical-datastore/commit/673ac1f326a2a20e847b751bbcf70958d78dea31 removed enum type for denormalize from the spec. Instead, we can keep the enum and implement the server in a way that it reads multiple values passed as different denormalize query arguments.

The enum makes the specs clearer and simplifies client and server code (no need to join and split values with comma). The client can pass multiple values as ?denormalize=time&denormalize=name.

The https://golang.org/pkg/net/url/#Values.Get function returns the first value only:

But https://golang.org/pkg/net/url/#Values is a map of map[string][]string. See examples.