Documentation ¶
Overview ¶
Package jsonarray provides an interface to stream an array of JSON objects to an io.Writer. This is useful for streaming long JSON arrays to an HTTP response.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder[T any] struct { // contains filtered or unexported fields }
func (*Encoder[T]) Encode ¶
Encode writes a JSON object to the underlying io.Writer. If the ArrayEncoder was created with hotPipe set to true, it will also flush the writer after writing the object. It is assumed that writing is being done in a single goroutine. If there's a chance of concurrent writes, lock the function invocation with a mutex.
Click to show internal directories.
Click to hide internal directories.