Documentation
¶
Index ¶
- func Diff(cachedHashes, diskHashes map[string]string) (changed, deleted []string)
- type Cache
- func (c *Cache) ClearContentHTML() error
- func (c *Cache) Close() error
- func (c *Cache) Delete(filePath string) error
- func (c *Cache) DeleteMany(filePaths []string) error
- func (c *Cache) GetState(key string) (string, error)
- func (c *Cache) LoadAll() ([]*PageRecord, error)
- func (c *Cache) LoadHashes() (map[string]string, error)
- func (c *Cache) LoadPlainTexts() (map[string]string, error)
- func (c *Cache) LoadStatMap() (map[string]StatEntry, error)
- func (c *Cache) Save(r *PageRecord) error
- func (c *Cache) SaveBatch(records []*PageRecord) error
- func (c *Cache) SetState(key, value string) error
- type PageRecord
- type StatEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache manages the SQLite build cache.
func (*Cache) ClearContentHTML ¶ added in v0.2.0
ClearContentHTML is a no-op — content_html is no longer stored in the cache. Pages that need re-rendering are detected via file hash changes and the layoutChanged / renderVersion flags in build state.
func (*Cache) DeleteMany ¶
DeleteMany removes multiple page records.
func (*Cache) LoadAll ¶
func (c *Cache) LoadAll() ([]*PageRecord, error)
LoadAll returns all cached page records without content_plain. Call LoadPlainTexts separately when the search index needs to be rebuilt.
func (*Cache) LoadHashes ¶
LoadHashes returns a map of file_path → file_hash for all cached pages.
func (*Cache) LoadPlainTexts ¶ added in v0.2.0
LoadPlainTexts returns file_path → content_plain for all cached pages. Called only when the search index needs rebuilding (contentChange = true).
func (*Cache) LoadStatMap ¶ added in v0.2.0
LoadStatMap returns a map of file_path → StatEntry (hash + size + mtime). Used as a pre-filter to skip SHA-256 when stat fields match the cached values.
func (*Cache) Save ¶
func (c *Cache) Save(r *PageRecord) error
Save upserts a single page record into the cache.
func (*Cache) SaveBatch ¶ added in v0.2.0
func (c *Cache) SaveBatch(records []*PageRecord) error
SaveBatch upserts all records in a single transaction — far faster than calling Save() per page on large corpora.
type PageRecord ¶
type PageRecord struct {
FilePath string
FileHash string
FileSize int64
FileMtime int64
Permalink string
Title string
LinkTitle string
Description string
Tags []string
Categories []string
Keywords []string
Date time.Time
PublishDate time.Time
ExpiryDate time.Time
Lastmod time.Time
Section string
Lang string
Depth int
WordCount int
ReadingTime int
Summary string
ContentPlain string
ContentHTML string
Params map[string]any
Weight int
NoIndex bool
ExcludeSearch bool
Type string
Layout string
Slug string
URL string
Aliases []string
Draft bool
Kind string
BuiltAt int64
}
PageRecord is a row from page_cache.