jsonl

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package jsonl keeps people's acts as JSON lines appended to a file, one act a line, for any tool that reads JSON lines (and for cartograph ux) to analyse. Several servers may append to one file on a shared volume: each line is written whole in one call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(in io.Reader) ([]activity.Event, error)

Read reads every act in a JSON lines stream, skipping lines that are not acts.

Types

type Files

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

Files reads the acts in one or more files a Recorder appended to.

func NewReader

func NewReader(paths ...string) Files

NewReader reads the files at paths.

func (Files) Read

func (f Files) Read(_ context.Context, q activity.Query) ([]activity.Event, error)

Read returns the acts q asks for from every file, in the order they happened.

type Recorder

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

Recorder appends acts to a file.

func Open

func Open(path string) (*Recorder, error)

Open appends to the file at path, creating it.

func (*Recorder) Close

func (r *Recorder) Close() error

Close closes the file.

func (*Recorder) Record

func (r *Recorder) Record(e activity.Event)

Record appends one act. A write that fails is dropped: a trace never fails the act it records.

Jump to

Keyboard shortcuts

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