Added NDJSON decoder (#1281)

This commit is contained in:
Mike Farah
2022-07-27 12:26:22 +10:00
committed by GitHub
parent c2c48bbe1d
commit b9a1ef89fe
13 changed files with 425 additions and 15 deletions
+3
View File
@@ -14,6 +14,7 @@ const (
XMLInputFormat
PropertiesInputFormat
Base64InputFormat
JsonInputFormat
)
type Decoder interface {
@@ -29,6 +30,8 @@ func InputFormatFromString(format string) (InputFormat, error) {
return XMLInputFormat, nil
case "props", "p":
return PropertiesInputFormat, nil
case "json", "ndjson", "j":
return JsonInputFormat, nil
default:
return 0, fmt.Errorf("unknown format '%v' please use [yaml|xml|props]", format)
}