Documentation
¶
Overview ¶
Package browse lists the OKF tree by walking it on disk and annotating each file with the index metadata mnemos holds for it. The disk walk is the source of truth for what exists (so not-yet-indexed files are visible); the index supplies title/type/tags/collection and the "indexed" flag. It adds no retrieval logic of its own — it reuses the ingest scanner predicate and the storage document lister.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
URI string `json:"uri"`
Indexed bool `json:"indexed"`
Collection string `json:"collection,omitempty"`
Title string `json:"title,omitempty"`
Type string `json:"type,omitempty"`
Tags []string `json:"tags,omitempty"`
ModifiedAt string `json:"modified_at,omitempty"`
SizeBytes int64 `json:"size_bytes"`
}
Entry is one file in the OKF tree with its index annotation. Collection, Title, Type, Tags, and ModifiedAt are populated only when the file is indexed.
func List ¶
func List(ctx context.Context, db *sql.DB, treeRoot string, include, exclude, secExclude []string, o Options) ([]Entry, error)
List walks treeRoot and returns entries sorted by uri, annotated from the index. include/exclude/secExclude are the indexing globs (the same sets the ingest scanner uses); a file is listed when Options.All is set or it matches those globs. The internal .mnemos directory is always skipped.
type Options ¶
type Options struct {
Collection string
PathPrefix string
FileType string
All bool
IndexedOnly bool
UnindexedOnly bool
Limit int
}
Options narrows a List call. Empty string fields are ignored. All includes every file on disk (not just indexable ones); IndexedOnly / UnindexedOnly restrict to files that are / are not in the index.