aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-02-06 18:11:10 +0100
committerSantiago M. Mola <santi@mola.io>2017-02-06 18:11:59 +0100
commit2b1efd219e1f20d9a0bc380a26074c9d8de2ae1f (patch)
tree9c75fd75bd905c2bcf736b0d87e5dde81ad230a4
parent70eff0d7bd1f69856f8028c2487576085a54a42c (diff)
downloadgo-git-2b1efd219e1f20d9a0bc380a26074c9d8de2ae1f.tar.gz
doc: improve docs for object package.
* add package description. * add godoc to DecodeBlob. * clarify godoc for Object and Blob.
-rw-r--r--plumbing/object/blob.go3
-rw-r--r--plumbing/object/object.go7
2 files changed, 7 insertions, 3 deletions
diff --git a/plumbing/object/blob.go b/plumbing/object/blob.go
index f274e70..76b0e7d 100644
--- a/plumbing/object/blob.go
+++ b/plumbing/object/blob.go
@@ -8,7 +8,7 @@ import (
"srcd.works/go-git.v4/utils/ioutil"
)
-// Blob is used to store file data - it is generally a file.
+// Blob is used to store arbitrary data - it is generally a file.
type Blob struct {
Hash plumbing.Hash
Size int64
@@ -26,6 +26,7 @@ func GetBlob(s storer.EncodedObjectStorer, h plumbing.Hash) (*Blob, error) {
return DecodeBlob(o)
}
+// DecodeObject decodes an encoded object into a *Blob.
func DecodeBlob(o plumbing.EncodedObject) (*Blob, error) {
b := &Blob{}
if err := b.Decode(o); err != nil {
diff --git a/plumbing/object/object.go b/plumbing/object/object.go
index 51d9bc4..5512932 100644
--- a/plumbing/object/object.go
+++ b/plumbing/object/object.go
@@ -1,3 +1,5 @@
+// Package object contains implementations of all Git objects and utility
+// functions to work with them.
package object
import (
@@ -35,8 +37,9 @@ var ErrUnsupportedObject = errors.New("unsupported object type")
// }
// }
//
-// This interface is intentionally different from plumbing.EncodedObject, which is a lower
-// level interface used by storage implementations to read and write objects.
+// This interface is intentionally different from plumbing.EncodedObject, which
+// is a lower level interface used by storage implementations to read and write
+// objects in its encoded form.
type Object interface {
ID() plumbing.Hash
Type() plumbing.ObjectType