gdDocumentation0.8.0

API reference

GDJSONLReader

Reader decoding JSON Lines one line at a time as chunks arrive.

Methods

feed

feed(chunk: String) -> Array, Err

Append an input fragment to the incremental decoder.

Parameters

NameTypeDefaultDescription
chunkStringRequiredNext input fragment, appended to previously buffered input.

Return value

Array, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

finish

finish() -> Array, Err

Call when the input source ends.

Parameters

No parameters.

Return value

Array, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.