store

package
v0.0.0-...-4c7552c Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaSQL = `` /* 2253-byte string literal not displayed */

Variables

View Source
var ChunkSize = chunkSizeFromEnv(2 * 1024 * 1024)

ChunkSize is the per-chunk byte budget for PDF ingest. 2 MiB is small enough to fit a single bytea TOAST page comfortably and large enough that a 50 MB paper produces only ~25 chunks. Override with PDFDB_CHUNK_SIZE.

Functions

func LoadDotEnv

func LoadDotEnv(path string)

Types

type Document

type Document struct {
	ID        uuid.UUID `json:"id"`
	Slug      string    `json:"slug"`
	Title     string    `json:"title"`
	Filename  string    `json:"filename"`
	Mime      string    `json:"mime"`
	SourceURL string    `json:"sourceUrl,omitempty"`
	SHA256    string    `json:"sha256"`
	SizeBytes int64     `json:"sizeBytes"`
	PageCount int       `json:"pageCount"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type Store

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

func Open

func Open(ctx context.Context, databaseURL string) (*Store, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) GetDocument

func (s *Store) GetDocument(ctx context.Context, key string) (*Document, error)

func (*Store) Ingest

func (s *Store) Ingest(ctx context.Context, source string) (*Document, error)

func (*Store) Init

func (s *Store) Init(ctx context.Context) error

func (*Store) ListDocuments

func (s *Store) ListDocuments(ctx context.Context) ([]Document, error)

func (*Store) ReadRange

func (s *Store) ReadRange(ctx context.Context, docID uuid.UUID, start, end int64) ([]byte, error)

func (*Store) Reconstruct

func (s *Store) Reconstruct(ctx context.Context, docID uuid.UUID) ([]byte, error)

func (*Store) Verify

func (s *Store) Verify(ctx context.Context) error

Jump to

Keyboard shortcuts

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