jsonl

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package jsonl provides streaming JSONL readers with optional line size limits.

Index

Constants

This section is empty.

Variables

View Source
var ErrLineTooLong = errors.New("jsonl line exceeds max size")

ErrLineTooLong is returned when a JSONL line exceeds the configured max size.

Functions

This section is empty.

Types

type Line

type Line struct {
	Data      []byte
	BytesRead int
	TooLong   bool
}

Line represents a single JSONL line read from a stream. Data excludes trailing newline characters. BytesRead includes any newline bytes consumed.

type Reader

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

Reader streams JSONL lines from an io.Reader.

func NewReader

func NewReader(r io.Reader, maxLineBytes int) *Reader

NewReader creates a new JSONL streaming reader. maxLineBytes of 0 disables the line size limit.

func (*Reader) Next

func (r *Reader) Next() (Line, error)

Next reads the next JSONL line. It returns io.EOF when no more data remains. If the line exceeds maxLineBytes, TooLong is set and Data is nil.

Jump to

Keyboard shortcuts

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