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:
23
api/schema_type.go
Normal file
23
api/schema_type.go
Normal file
@ -0,0 +1,23 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func (v SchemaType) String() string {
|
||||
return string(v)
|
||||
}
|
||||
|
||||
// Set implements the cli.Generic interface for parsing
|
||||
// flags.
|
||||
func (v *SchemaType) Set(s string) error {
|
||||
switch s {
|
||||
case string(SCHEMATYPE_IMPLICIT):
|
||||
*v = SCHEMATYPE_IMPLICIT
|
||||
case string(SCHEMATYPE_EXPLICIT):
|
||||
*v = SCHEMATYPE_EXPLICIT
|
||||
default:
|
||||
return fmt.Errorf("unsupported schema type: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user