origin

package
v0.62.0 Latest Latest
Warning

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

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

Documentation

Overview

Package origin binds each reader's bounded input snapshot to its original revision. Parsers, normalizers and splitters never hash rendered text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parts

Parts numbers only documents that were actually emitted. Parser output is generally not an exact byte slice, so Split discards any inherited byte span.

func Read

func Read(ctx context.Context, r io.Reader, budget etl.SourceBudget, name string) ([]byte, *document.Provenance, error)

func Span

func Span(p *document.Provenance, start, end int64) *document.Provenance

Span identifies bytes only when the parser can prove both original offsets. An anonymous single document need not acquire a fabricated source identity.

Types

type Stream

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

Stream admits one read of a sequential source, including a read that fails after advancing its offset. A caller cannot attest its suffix as a revision.

func NewStream

func NewStream(source io.Reader) *Stream

func (*Stream) Read

func (s *Stream) Read(ctx context.Context, budget etl.SourceBudget, name string) ([]byte, *document.Provenance, error)

Jump to

Keyboard shortcuts

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