feat: add JSON input support for biological sequences

Introduce a streaming JSON parser that decodes biological sequences using `goccy/go-json` with configurable batching to minimize memory overhead. Extend the CLI, file suffix filters, and MIME type detection to automatically recognize and route JSON inputs. Refactor header parsing into a centralized switch-case handler for improved maintainability.
This commit is contained in:
Eric Coissac
2026-07-03 10:16:55 +02:00
parent 9de463ef1e
commit d735ac6188
6 changed files with 273 additions and 97 deletions
+2
View File
@@ -145,6 +145,8 @@ func ReadSequencesFromFile(filename string,
return ReadGenbank(reader, options...)
case "text/csv":
return ReadCSV(reader, options...)
case "application/json":
return ReadJSON(reader, options...)
default:
log.Fatalf("File %s has guessed format %s which is not yet implemented",
filename, mime.String())