diff options
Diffstat (limited to 'cache')
-rw-r--r-- | cache/cache.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cache/cache.go b/cache/cache.go new file mode 100644 index 0000000..32b8325 --- /dev/null +++ b/cache/cache.go @@ -0,0 +1,20 @@ +package cache + +import ( + "code.laria.me/petrific/objects" + "time" +) + +type Cache interface { + PathUpdated(path string) (mtime time.Time, id objects.ObjectId, ok bool) + SetPathUpdated(path string, mtime time.Time, id objects.ObjectId) +} + +type NopCache struct{} + +func (NopCache) PathUpdated(_ string) (_ time.Time, _ objects.ObjectId, ok bool) { + ok = false + return +} + +func (NopCache) SetPathUpdated(_ string, _ time.Time, _ objects.ObjectId) {} |