sync

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package sync reconciles the filesystem (walker + digest) with the persisted Bleve index, using mtime/size fast-path and digest equality to skip unchanged docs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteMeta

func WriteMeta(path string, m Meta) error

WriteMeta serializes m to path, creating the parent directory if needed.

Types

type Meta

type Meta struct {
	SchemaVersion int       `json:"schema_version"`
	LastSyncAt    time.Time `json:"last_sync_at"`
}

Meta is the JSON sidecar written next to the Bleve index.

func ReadMeta

func ReadMeta(path string) (Meta, error)

ReadMeta returns the persisted Meta or an empty Meta if the file does not exist.

type Result

type Result struct {
	Scanned   int // files visited by the walker
	Upserted  int // new or content-changed docs written
	Touched   int // unchanged bodies but mtime/size metadata refreshed
	Deleted   int // index entries removed because the file is gone
	Unchanged int // fast-path skips (mtime + size matched stored)
}

Result reports what a single Run did.

func Run

func Run(ctx context.Context, cfg *config.IndexConfig) (Result, error)

Run reconciles the filesystem with the index in cfg.IndexPath(). The index must already exist (call init first). Returns a Result describing the work performed.

Jump to

Keyboard shortcuts

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