jsonl

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package jsonl implements sink.Sink as JSON Lines: one JSON object per classified record, the pipe-friendly lingua franca of log tooling.

The wire shape per line is {"id", "kind", "data", "fields", "meta", "category", "confidence", "stage", "reasons"}, where kind, fields, meta, stage, and reasons appear only when present, and kind only for structured payloads, so a plain text record serializes exactly as it always has.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sink

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

Sink writes one JSON object per record to an io.Writer. Output is buffered; Close flushes. The underlying writer is not closed; the caller owns it (it is usually stdout). Not safe for concurrent Write: the engine drives a sink from one goroutine, and the scratch buffers rely on that.

func New

func New(w io.Writer) *Sink

New returns a Sink writing JSON Lines to w.

func (*Sink) Close

func (s *Sink) Close() error

Close implements sink.Sink: flushes buffered output. Safe to call more than once.

func (*Sink) Write

Write implements sink.Sink, appending one record to the output buffer and flushing it once it fills.

Jump to

Keyboard shortcuts

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