
* refactor: take clients out of internal * refactor: move stdio to pkg * Move internal/api to api * refactor: final changes for Kapacitor to access shared functionality * chore: regenerate mocks * fix: bad automated refactor * chore: extra formatting not caught by make fmt
18 lines
357 B
Go
18 lines
357 B
Go
package bucket_schema
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/influxdata/influx-cli/v2/api"
|
|
)
|
|
|
|
func decodeJson(r io.Reader) ([]api.MeasurementSchemaColumn, error) {
|
|
var rows []api.MeasurementSchemaColumn
|
|
if err := json.NewDecoder(r).Decode(&rows); err != nil {
|
|
return nil, fmt.Errorf("error decoding JSON: %w", err)
|
|
}
|
|
return rows, nil
|
|
}
|