Help us shape the future of Go! Take the 2026 Go Developer Survey

jsonl

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package jsonl is the default durable thread.Storage: one directory, one <id>.jsonl file per session — the header line first, then one entry per line in append order (ADR 0011). A session file is what the format is: readable with jq, backup-able with cp, append-only.

The durability rules (ADR 0011 §4–§5): Create writes the header and fsyncs the file and the directory; Append writes all of its entries in one write and fsyncs (FsyncOnFlush defers that to Flush). One writer per session, enforced with an advisory lock held from a session's first write until the process exits or the session is deleted — a second writer, in this process or another, fails with thread.ErrLocked. Readers never lock: Load and List read at any time, and a load that catches a torn final line (a crash mid-write) drops it and says so in the LoadReport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(dir string, opts ...thread.OpenOption) (thread.Storage, error)

Open returns a thread.Storage rooted at dir: one <id>.jsonl file per session, the directory created 0700 when missing and files created 0600. opts are the shared open vocabulary — Salvage, the fsync policy — resolved with the defaults by thread.ResolveOpen.

Types

This section is empty.

Jump to

Keyboard shortcuts

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