Csv decoder (#1290)

* WIP: adding CSV decoder

* Adding CSV decoder

* Added CSV roundtrip

* Fixing from review
This commit is contained in:
Mike Farah
2022-08-01 10:28:34 +10:00
committed by GitHub
parent 3c222d8707
commit c8815f5ab9
20 changed files with 837 additions and 87 deletions
+6
View File
@@ -15,6 +15,8 @@ const (
PropertiesInputFormat
Base64InputFormat
JsonInputFormat
CSVObjectInputFormat
TSVObjectInputFormat
)
type Decoder interface {
@@ -32,6 +34,10 @@ func InputFormatFromString(format string) (InputFormat, error) {
return PropertiesInputFormat, nil
case "json", "ndjson", "j":
return JsonInputFormat, nil
case "csv", "c":
return CSVObjectInputFormat, nil
case "tsv", "t":
return TSVObjectInputFormat, nil
default:
return 0, fmt.Errorf("unknown format '%v' please use [yaml|xml|props]", format)
}