diff options
Diffstat (limited to 'core/storage.go')
-rw-r--r-- | core/storage.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/storage.go b/core/storage.go index f3225d8..f3ec52b 100644 --- a/core/storage.go +++ b/core/storage.go @@ -9,7 +9,16 @@ var ErrStop = errors.New("stop iter") type ObjectStorage interface { NewObject() Object Set(Object) (Hash, error) - Get(Hash) (Object, error) + // Get an object by hash with the given ObjectType. + // + // Implementors should return (nil, core.ErrObjectNotFound) if an object + // doesn't exist with both the given hash and object type. + // + // Valid ObjectType values are CommitObject, BlobObject, TagObject, TreeObject + // and AnyObject. + // + // If AnyObject is given, the object must be looked up regardless of its type. + Get(Hash, ObjectType) (Object, error) Iter(ObjectType) (ObjectIter, error) } |