cache

package
v0.1.80 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cache provides a file-hash cache for incremental scanning. Only files whose content has changed since the last run are rescanned.

Index

Constants

View Source
const DefaultPath = ".broly-cache.json"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Hashes map[string]string `json:"hashes"`
	// contains filtered or unexported fields
}

func Load

func Load(path string) (*Cache, error)

Load reads the cache from disk. Returns an empty cache if the file does not exist.

func (*Cache) Changed

func (c *Cache) Changed(path string) bool

Changed reports whether the file has changed since it was last recorded. Returns true for files that cannot be read or have not been seen before.

func (*Cache) Save

func (c *Cache) Save() error

Save writes the cache to disk.

func (*Cache) Update

func (c *Cache) Update(path string)

Update records the current hash for a file.

Jump to

Keyboard shortcuts

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