statcache

package
v1.123.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package statcache is the per-machine sidecar that remembers what each file looked like when it was last read, so a run can detect changes that mtime and size alone miss and can be dropped at any time without losing correctness.

Index

Constants

View Source
const TTL = 30 * 24 * time.Hour

TTL is how long an entry lasts after it was last stored or matched.

Variables

View Source
var ErrLocked = errors.New("another process has the cache open")

ErrLocked is returned by Open when another process has the cache open.

Functions

This section is empty.

Types

type Cache

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

Cache is a badger-backed backup.StatCache. An entry neither stored nor matched within TTL expires.

func Open

func Open(dir string) (*Cache, error)

Open opens or creates the cache in dir. It fails with ErrLocked while another process has it open.

func (*Cache) Close

func (c *Cache) Close() error

Close closes the database.

func (*Cache) Lookup

func (c *Cache) Lookup(path string, info os.FileInfo, ref *proto.Ref) (present bool, matched bool)

Lookup implements backup.StatCache.

func (*Cache) Store

func (c *Cache) Store(path string, info os.FileInfo, ref *proto.Ref) error

Store implements backup.StatCache.

Jump to

Keyboard shortcuts

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