* feat: v1 dbrp commands
* fix: fixed the cloud create command
* chore: cleanup
* fix: updated based on required attrs in swagger
* feat: update to latest openapi rev
* chore: made dbrps plural consistently
* chore: formatting
* fix: standardized Default field name and added comments
* chore: changed file name for command to singular
* feat(write): warn about standalone CR characters in header lines
* feat(write): add test for Windows CRLF line endings
* chore: improve warning message
Co-authored-by: Daniel Moran <danxmoran@gmail.com>
* chore: update test with a new warning message
Co-authored-by: Daniel Moran <danxmoran@gmail.com>
* 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
I started to see strange behavior where flags would merge across
subcommands. I'm not sure if the bug was in our 'append' usage or
in urfave/cli's handling of flag-slices, but this change seems to
fix the problem either way.
* build: add goimports to fmt target to remove unused imports
* feat: update codegen template to support returning raw response body
* feat: add support for gunzip-ing response bodies
* refactor: remove unused piece from codegen return values
* feat: update generated client to include schema-management APIs
* feat: implement interfaces to decode flags and CSV
* feat: implement decoders for different measurement schema column formats
* feat: extend bucket CLI commands to support schema type property
* feat: add CLI commands to manage measurement schema
* test: add unit tests for bucket schema create, update and list commands
This commit represents a few experiments of features I've used in Cobra
1. Uses cli.GenericFlag to encapsulate parsing and validation of flag
values at parse time. This removes the burden from the individual
CLI commands to parse and validate args and options.
2. Add influxid.ID that may be used by any flag that requires an
Influx ID. influxid.ID parses and validates string value is a valid
ID, removing this burden from individual commands and ensuring valid
values before the command actions begins.
3. Binds cli.Flags directly to params structures to directly capture
the values when parsing flags.
4. Moves from global state to local builder functions for the majority
of the commands. This allows the commands to bind to flag variables
reducing the repeated ctx.String(), ctx.Int(), etc
5. Leverages the BeforeFunc to create middleware and inject the CLI and
API client into commands, saving the repeated boilerplate across
all of the instantiated commands. This is extensible, so additional
middleware can be appends using the middleware.WithBeforeFns