ndjsonscanner

package
v0.0.0-...-4eb781d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 8 Imported by: 0

README

This library provides a convenience wrapper for fetching remote data formatted as newline-delimited json.

Library doesn't support plain json string, json has to match: map[string]interface{}.

Documentation

Index

Constants

View Source
const MaxScanTokenSize = 2000 * 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type NDJSONScanner

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

func NewBufferScanner

func NewBufferScanner(reader io.ReadCloser) *NDJSONScanner

func NewURLScanner

func NewURLScanner(ctx context.Context, httpClient *http.Client, url string) (*NDJSONScanner, error)

func (*NDJSONScanner) Bytes

func (ns *NDJSONScanner) Bytes() []byte

func (*NDJSONScanner) Close

func (ns *NDJSONScanner) Close() error

func (*NDJSONScanner) ContentLength

func (ns *NDJSONScanner) ContentLength() int64

func (*NDJSONScanner) Err

func (ns *NDJSONScanner) Err() error

func (*NDJSONScanner) Scan

func (ns *NDJSONScanner) Scan() bool

Jump to

Keyboard shortcuts

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