diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-11-07 20:29:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-07 20:29:58 +0100 |
commit | 0ff9ef2b44c53e557c78bde0fd9c29847e5f0e23 (patch) | |
tree | b9c7485fe99e6e89fa736ceb0223aeb2ecddb77c /core/memory.go | |
parent | f6ed7424cbf33c7013332d7e95b4262a4bc4a523 (diff) | |
download | go-git-0ff9ef2b44c53e557c78bde0fd9c29847e5f0e23.tar.gz |
global storage interface refactor (#112)
* core: ObjectStorage, ReferenceStorage renamed to ObjectStorer and
ReferenceStorer
* rebase
* general, changes request by @alcortes
* general, changes request by @alcortes
Diffstat (limited to 'core/memory.go')
-rw-r--r-- | core/memory.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/memory.go b/core/memory.go index 97b1b9b..dabee3a 100644 --- a/core/memory.go +++ b/core/memory.go @@ -1,7 +1,8 @@ -package core +package core import ( "bytes" + "io" "io/ioutil" ) @@ -39,12 +40,12 @@ func (o *MemoryObject) Size() int64 { return o.sz } func (o *MemoryObject) SetSize(s int64) { o.sz = s } // Reader returns a ObjectReader used to read the object's content. -func (o *MemoryObject) Reader() (ObjectReader, error) { +func (o *MemoryObject) Reader() (io.ReadCloser, error) { return ioutil.NopCloser(bytes.NewBuffer(o.cont)), nil } // Writer returns a ObjectWriter used to write the object's content. -func (o *MemoryObject) Writer() (ObjectWriter, error) { +func (o *MemoryObject) Writer() (io.WriteCloser, error) { return o, nil } |