Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SHA256File ¶
SHA256File computes the SHA256 hex digest of the file at path.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is an in-memory SHA256 file cache backed by a JSON file on disk. It is safe for concurrent read access but writes must go through Mark/Save.
func Load ¶
Load reads the cache from dir/cache.json. If the file does not exist, an empty cache is returned. dir is created if it does not exist.
func (*Cache) DeletePrefix ¶ added in v1.3.0
DeletePrefix removes all cache entries whose path is rooted under prefix. It returns true when at least one entry was removed.
func (*Cache) IsCached ¶
IsCached returns true if path has been processed with the given sha256 hash.
Click to show internal directories.
Click to hide internal directories.