Documentation
¶
Index ¶
- type DocSummary
- type PageEntry
- type Store
- func (s *Store) DeleteAllByPrefix(dirPrefix string) error
- func (s *Store) DeleteByDoc(docPath string) error
- func (s *Store) GetByDoc(docPath string) ([]*PageEntry, error)
- func (s *Store) ListDocsSummary(dirPrefix string) ([]*DocSummary, error)
- func (s *Store) UpdateLabels(docPath string, pageNum int, labels []string) error
- func (s *Store) Upsert(entry *PageEntry) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocSummary ¶
type DocSummary struct {
DocPath string `json:"docPath"`
PageCount int `json:"pageCount"`
Pages []*PageEntry `json:"pages,omitempty"`
IndexedAt int64 `json:"indexedAt"`
}
DocSummary holds a document's metadata for the UI listing. Pages is only populated by callers that explicitly attach full page data; the docs listing leaves it empty to keep the payload small.
type PageEntry ¶
type PageEntry struct {
ID string `json:"id"`
DocPath string `json:"docPath"`
PageNum int `json:"pageNum"`
Keywords []string `json:"keywords"`
Labels []string `json:"labels"`
IndexedAt int64 `json:"indexedAt"`
}
PageEntry represents a single indexed page in a PDF document.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides persistence for doc_page_index entries.
func (*Store) DeleteAllByPrefix ¶
DeleteAllByPrefix deletes all entries for docs whose path starts with dirPrefix.
func (*Store) DeleteByDoc ¶
DeleteByDoc removes all PageEntry rows for a given document path.
func (*Store) ListDocsSummary ¶
func (s *Store) ListDocsSummary(dirPrefix string) ([]*DocSummary, error)
ListDocsSummary returns one DocSummary per unique doc_path whose path starts with dirPrefix. It aggregates in a single query and does not load per-page label data — callers that need full pages should use GetByDoc.
func (*Store) UpdateLabels ¶
UpdateLabels updates only the labels field for a specific page.