aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/cache/common.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-07-27 14:55:47 +0200
committerGitHub <noreply@github.com>2017-07-27 14:55:47 +0200
commit8c57f96d4678087e06035095e67ad1239d6509ce (patch)
treea1468ab8a942435435c644abdc9bac3338990bc2 /plumbing/cache/common.go
parent854ffa16f650706200a6ebb5505bb448b5c64035 (diff)
parentae1c4f3df729c3a7fed4cd5a1f530c95d640497a (diff)
downloadgo-git-8c57f96d4678087e06035095e67ad1239d6509ce.tar.gz
Merge pull request #514 from smola/use-cache-delta
cache: reuse object cache for delta resolution, use LRU policy
Diffstat (limited to 'plumbing/cache/common.go')
-rw-r--r--plumbing/cache/common.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/plumbing/cache/common.go b/plumbing/cache/common.go
index 7b90c55..9efc26c 100644
--- a/plumbing/cache/common.go
+++ b/plumbing/cache/common.go
@@ -11,8 +11,14 @@ const (
type FileSize int64
+// Object is an interface to a object cache.
type Object interface {
- Add(o plumbing.EncodedObject)
- Get(k plumbing.Hash) plumbing.EncodedObject
+ // Put puts the given object into the cache. Whether this object will
+ // actually be put into the cache or not is implementation specific.
+ Put(o plumbing.EncodedObject)
+ // Get gets an object from the cache given its hash. The second return value
+ // is true if the object was returned, and false otherwise.
+ Get(k plumbing.Hash) (plumbing.EncodedObject, bool)
+ // Clear clears every object from the cache.
Clear()
}