Documentation
¶
Index ¶
- Constants
- Variables
- func LoadDotEnv(path string)
- type Document
- type Store
- func (s *Store) Close()
- func (s *Store) GetDocument(ctx context.Context, key string) (*Document, error)
- func (s *Store) Ingest(ctx context.Context, source string) (*Document, error)
- func (s *Store) Init(ctx context.Context) error
- func (s *Store) ListDocuments(ctx context.Context) ([]Document, error)
- func (s *Store) ReadRange(ctx context.Context, docID uuid.UUID, start, end int64) ([]byte, error)
- func (s *Store) Reconstruct(ctx context.Context, docID uuid.UUID) ([]byte, error)
- func (s *Store) Verify(ctx context.Context) error
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 (*Store) GetDocument ¶
func (*Store) ListDocuments ¶
func (*Store) Reconstruct ¶
Click to show internal directories.
Click to hide internal directories.