aboutsummaryrefslogtreecommitdiff
path: root/cache
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2017-07-03 08:10:28 +0200
committerLaria Carolin Chabowski <laria@laria.me>2017-07-12 08:02:14 +0200
commit78754a7b23e5fc7a40bd3c450d54a193aaf585b1 (patch)
tree5aff6436cbf93212aab6bb59a077a5718c0fbc23 /cache
parent43d099919d1e1a8d6b38a300182d0cc075237fe6 (diff)
downloadpetrific-78754a7b23e5fc7a40bd3c450d54a193aaf585b1.tar.gz
petrific-78754a7b23e5fc7a40bd3c450d54a193aaf585b1.tar.bz2
petrific-78754a7b23e5fc7a40bd3c450d54a193aaf585b1.zip
Implementing backup methods
Diffstat (limited to 'cache')
-rw-r--r--cache/cache.go20
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) {}