index

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildMetadata

type BuildMetadata struct {
	BuildDurationMs int `json:"build_duration_ms"`
	FilesProcessed  int `json:"files_processed"`
	CacheHits       int `json:"cache_hits"`
	APICalls        int `json:"api_calls"`
}

BuildMetadata contains information about the index build process

type ComputedIndex

type ComputedIndex struct {
	Version       string        `json:"version"`
	GeneratedAt   time.Time     `json:"generated_at"`
	DaemonVersion string        `json:"daemon_version"`
	Index         *types.Index  `json:"index"`
	Metadata      BuildMetadata `json:"metadata"`
}

ComputedIndex represents the precomputed index file structure. This wraps the core types.Index with additional metadata about the index file itself (version, generation time, daemon info).

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles loading, saving, and updating the computed index

func NewManager

func NewManager(indexPath string) *Manager

NewManager creates a new index manager

func (*Manager) GetCurrent

func (m *Manager) GetCurrent() *types.Index

GetCurrent returns the current index (thread-safe read)

func (*Manager) LoadComputed

func (m *Manager) LoadComputed() (*ComputedIndex, error)

LoadComputed loads the computed index from disk with validation

func (*Manager) RemoveFile

func (m *Manager) RemoveFile(path string) (RemoveResult, error)

RemoveFile removes a file entry from the index with result tracking

func (*Manager) SetIndex

func (m *Manager) SetIndex(index *types.Index, metadata BuildMetadata)

SetIndex sets the current index (used by daemon when building)

func (*Manager) UpdateSingle

func (m *Manager) UpdateSingle(entry types.IndexEntry, info UpdateInfo) (UpdateResult, error)

UpdateSingle updates a single entry in the index with tracking info

func (*Manager) WriteAtomic

func (m *Manager) WriteAtomic(daemonVersion string) error

WriteAtomic writes the computed index to disk atomically Uses temp file + sync + atomic rename to ensure consistency

type RemoveResult added in v0.12.1

type RemoveResult struct {
	Removed bool  // true if an entry was actually removed
	Size    int64 // size of the removed file
}

RemoveResult contains information about what was removed

type UpdateInfo added in v0.12.1

type UpdateInfo struct {
	WasAnalyzed bool // true if semantic analysis was performed (API call)
	WasCached   bool // true if cached analysis was used
	HadError    bool // true if there was an error processing this file
}

UpdateInfo provides context about the entry being updated

type UpdateResult added in v0.12.1

type UpdateResult struct {
	Added   bool // true if new entry was added (vs updated)
	Updated bool // true if existing entry was modified
}

UpdateResult contains information about what the update operation did

Jump to

Keyboard shortcuts

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