statcache

package
v1.120.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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