From 2b1efd219e1f20d9a0bc380a26074c9d8de2ae1f Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Mon, 6 Feb 2017 18:11:10 +0100 Subject: doc: improve docs for object package. * add package description. * add godoc to DecodeBlob. * clarify godoc for Object and Blob. --- plumbing/object/object.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plumbing/object/object.go') 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 -- cgit From 1f39465975d56bbb02f5cdfb1e3e77f41c613f1d Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Tue, 7 Feb 2017 10:02:20 +0100 Subject: doc: improve object iterators godoc. --- plumbing/object/object.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'plumbing/object/object.go') diff --git a/plumbing/object/object.go b/plumbing/object/object.go index 5512932..53c7e6c 100644 --- a/plumbing/object/object.go +++ b/plumbing/object/object.go @@ -158,14 +158,15 @@ type ObjectIter struct { s storer.EncodedObjectStorer } -// NewObjectIter returns a ObjectIter for the given repository and underlying -// object iterator. +// NewObjectIter takes a storer.EncodedObjectStorer and a +// storer.EncodedObjectIter and returns an *ObjectIter that iterates over all +// objects contained in the storer.EncodedObjectIter. func NewObjectIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *ObjectIter { return &ObjectIter{iter, s} } -// Next moves the iterator to the next object and returns a pointer to it. If it -// has reached the end of the set it will return io.EOF. +// Next moves the iterator to the next object and returns a pointer to it. If +// there are no more objects, it returns io.EOF. func (iter *ObjectIter) Next() (Object, error) { for { obj, err := iter.EncodedObjectIter.Next() -- cgit From f3554ac62e29fd3e06c6e1fdeda914ac19cb68fa Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Tue, 7 Feb 2017 17:46:53 +0100 Subject: doc: add godoc to Signature --- plumbing/object/object.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'plumbing/object/object.go') diff --git a/plumbing/object/object.go b/plumbing/object/object.go index 53c7e6c..ca5c541 100644 --- a/plumbing/object/object.go +++ b/plumbing/object/object.go @@ -77,11 +77,14 @@ func DecodeObject(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (Objec // DateFormat is the format being used in the original git implementation const DateFormat = "Mon Jan 02 15:04:05 2006 -0700" -// Signature represents an action signed by a person +// Signature is used to identify who and when created a commit or tag. type Signature struct { - Name string + // Name represents a person name. It is an arbitrary string. + Name string + // Email is an email, but it cannot be assumed to be well-formed. Email string - When time.Time + // When is the timestamp of the signature. + When time.Time } // Decode decodes a byte slice into a signature -- cgit