json

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL