jsonl

package
v0.1.6 Latest Latest
Warning

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

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

Documentation

Overview

Package jsonl runs a child process that reads one JSON value per line on standard input and writes one per line on standard output. The adapters (spec 09.2) and the custom checkers (spec 09.3) use it.

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("no reply in time")

ErrTimeout is the error of a reply that does not come in time. The process is killed.

Functions

func Errorf

func Errorf(line []byte, format string, args ...any) error

Errorf is a helper for a reply that is not what the protocol says.

Types

type Proc

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

Proc is a running child process.

func Start

func Start(dir string, argv []string, env []string) (*Proc, error)

Start starts argv in dir.

func (*Proc) Call

func (p *Proc) Call(v any, timeout time.Duration) ([]byte, error)

Call sends v as one line and waits for one line of reply.

func (*Proc) Close

func (p *Proc) Close()

Close sends bye, closes standard input and waits a short time for the process to stop.

func (*Proc) Kill

func (p *Proc) Kill()

Kill stops the process.

func (*Proc) Stderr

func (p *Proc) Stderr() string

Stderr returns the last part of the standard error of the process.

Jump to

Keyboard shortcuts

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