ancientlore / cachefs

Package cachefs implements a read-only cache around a fs.FS, using groupcache.
Other
5 stars 1 forks source link

cachefs: Add InvalidateCacheFS interface and extend cacheFS to implement it #4

Open tmc opened 2 years ago

tmc commented 2 years ago

This builds upon https://github.com/ancientlore/cachefs/pull/2 to expose an interface for point-invalidation of paths.

This would enable an interface like:

if cfs, ok := fs.(cachefs.InvalidateCacheFS); ok {
    cfs.InvalidateCacheFS("index.html") // error checking omitted.
}

Happy to flesh out some tests here but wanted to get a sense of your take first.