Documentation
¶
Overview ¶
Package json 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 ArrayEncoder ¶
type ArrayEncoder[T any] struct { // contains filtered or unexported fields }
func NewArrayEncoder ¶
func NewArrayEncoder[T any](w io.Writer, hotPipe bool) *ArrayEncoder[T]
func (*ArrayEncoder[T]) Encode ¶
func (ae *ArrayEncoder[T]) Encode(v T) error
func (*ArrayEncoder[T]) Finish ¶
func (ae *ArrayEncoder[T]) Finish() error
func (*ArrayEncoder[T]) Reset ¶
func (ae *ArrayEncoder[T]) Reset()
func (*ArrayEncoder[T]) SetIndent ¶
func (ae *ArrayEncoder[T]) SetIndent(prefix, indent string)
Click to show internal directories.
Click to hide internal directories.