sourcelocation

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package sourcelocation provides metadata about where an enrichment's content originates within a source file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithEnrichmentID

func WithEnrichmentID(id int64) repository.Option

WithEnrichmentID filters by the "enrichment_id" column.

Types

type SourceLocation

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

SourceLocation records the origin of an enrichment within its source file. For text chunks this is a line range; for page images this is a page number. Immutable value object.

func New

func New(enrichmentID int64, startLine, endLine int) SourceLocation

New creates a SourceLocation for a line range (not yet persisted).

func NewPage

func NewPage(enrichmentID int64, page int) SourceLocation

NewPage creates a SourceLocation for a page number (not yet persisted).

func NewWithPage added in v1.3.1

func NewWithPage(enrichmentID int64, page, startLine, endLine int) SourceLocation

NewWithPage creates a SourceLocation with both a page number and a line range.

func Reconstruct

func Reconstruct(id, enrichmentID int64, page, startLine, endLine int) SourceLocation

Reconstruct recreates a SourceLocation from persistence.

func (SourceLocation) EndLine

func (s SourceLocation) EndLine() int

EndLine returns the 1-based last line (0 means not applicable).

func (SourceLocation) EnrichmentID

func (s SourceLocation) EnrichmentID() int64

EnrichmentID returns the associated enrichment's ID.

func (SourceLocation) ID

func (s SourceLocation) ID() int64

ID returns the database identifier.

func (SourceLocation) Page

func (s SourceLocation) Page() int

Page returns the 1-based page number (0 means not applicable).

func (SourceLocation) StartLine

func (s SourceLocation) StartLine() int

StartLine returns the 1-based first line (0 means not applicable).

type Store

type Store interface {
	repository.Store[SourceLocation]
}

Store defines persistence for source locations.

Jump to

Keyboard shortcuts

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