json

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package json reads JSON values into documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader parses a JSON payload into *document.Document entries. Top-level arrays produce one document per element; every other JSON value produces one document containing its raw representation. Numbers retain their source spelling and are not restricted to the float64 range. Read admits one attempt on the sequential source. Reopen the input to retry after a failure; concurrent or later attempts return etl.ErrSourceConsumed.

func NewReader

func NewReader(source io.Reader, config ReaderConfig) (*Reader, error)

func (*Reader) Read

func (r *Reader) Read(ctx context.Context) ([]*document.Document, error)

type ReaderConfig

type ReaderConfig struct {
	// SourceName identifies the original input; empty means anonymous.
	SourceName   string
	SourceBudget etl.SourceBudget
}

ReaderConfig controls the whole-source memory budget. The zero budget uses etl.DefaultMaxSourceBytes.

Jump to

Keyboard shortcuts

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