corpus

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package corpus defines the neutral record unit that Stroma indexes.

Index

Constants

View Source
const (
	// DefaultKind is used when callers omit a more specific record kind.
	DefaultKind = "artifact"

	// FormatMarkdown stores Markdown bodies that can be heading-chunked.
	FormatMarkdown = "markdown"

	// FormatPlaintext stores plain text bodies as a single chunk.
	FormatPlaintext = "plaintext"
)

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint(records []Record) string

Fingerprint summarizes a set of records deterministically.

func HashRecord

func HashRecord(r Record) string

HashRecord returns a deterministic content hash for a normalized record.

Types

type Record

type Record struct {
	Ref         string
	Kind        string
	Title       string
	SourceRef   string
	BodyFormat  string
	BodyText    string
	ContentHash string
	Metadata    map[string]string
}

Record is the neutral corpus unit Stroma indexes.

func (Record) Normalized

func (r Record) Normalized() (Record, error)

Normalized returns a trimmed, validated record with safe defaults applied.

func (Record) Validate

func (r Record) Validate() error

Validate reports whether the record is complete enough to persist.

Jump to

Keyboard shortcuts

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