aboutsummaryrefslogtreecommitdiffstats
path: root/formats/packfile/read_recaller.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-06 19:59:44 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-06 19:59:44 +0200
commit98a22e72a808aa0d5dd62339817404fd9e1c4db6 (patch)
treed5544dce0176b55172f2fd25564618e8c0f18558 /formats/packfile/read_recaller.go
parentae2b10d50da5455b382ab9d543be4fe859afe9e0 (diff)
downloadgo-git-98a22e72a808aa0d5dd62339817404fd9e1c4db6.tar.gz
format: packfile new interface (wip)
Diffstat (limited to 'formats/packfile/read_recaller.go')
-rw-r--r--formats/packfile/read_recaller.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/formats/packfile/read_recaller.go b/formats/packfile/read_recaller.go
deleted file mode 100644
index a4157d1..0000000
--- a/formats/packfile/read_recaller.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package packfile
-
-import "gopkg.in/src-d/go-git.v4/core"
-
-var (
- // ErrDuplicatedObject is returned by Remember if an object appears several
- // times in a packfile.
- ErrDuplicatedObject = NewError("duplicated object")
- // ErrCannotRecall is returned by RecallByOffset or RecallByHash if the object
- // to recall cannot be returned.
- ErrCannotRecall = NewError("cannot recall object")
-)
-
-// The ReadRecaller interface has all the functions needed by a packfile
-// Parser to operate. We provide two very different implementations:
-// Seekable and Stream.
-type ReadRecaller interface {
- // Read reads up to len(p) bytes into p.
- Read(p []byte) (int, error)
- // ReadByte is needed because of these:
- // - https://github.com/golang/go/commit/7ba54d45732219af86bde9a5b73c145db82b70c6
- // - https://groups.google.com/forum/#!topic/golang-nuts/fWTRdHpt0QI
- // - https://gowalker.org/compress/zlib#NewReader
- ReadByte() (byte, error)
- // Offset returns the number of bytes parsed so far from the
- // packfile.
- Offset() (int64, error)
- // Remember ask the ReadRecaller to remember the offset and hash for
- // an object, so you can later call RecallByOffset and RecallByHash.
- Remember(int64, core.Object) error
- // ForgetAll forgets all previously remembered objects.
- ForgetAll()
- // RecallByOffset returns the previously processed object found at a
- // given offset.
- RecallByOffset(int64) (core.Object, error)
- // RecallByHash returns the previously processed object with the
- // given hash.
- RecallByHash(core.Hash) (core.Object, error)
-}