refactor: expose generated code and client business logic to share with Kapacitor (#103)
* 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
This commit is contained in:
25
api/write_precision.go
Normal file
25
api/write_precision.go
Normal file
@ -0,0 +1,25 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func (v WritePrecision) String() string {
|
||||
return string(v)
|
||||
}
|
||||
|
||||
func (v *WritePrecision) Set(s string) error {
|
||||
switch s {
|
||||
case "ms":
|
||||
*v = WRITEPRECISION_MS
|
||||
case "s":
|
||||
*v = WRITEPRECISION_S
|
||||
case "us":
|
||||
*v = WRITEPRECISION_US
|
||||
case "ns":
|
||||
*v = WRITEPRECISION_NS
|
||||
default:
|
||||
return fmt.Errorf("unsupported precision: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user