func (t ObjectType) Valid() bool {
	return t >= CommitObject && t <= REFDeltaObject
}
Valid returns true if t is a valid ObjectType.
package plumbing
import (
	"errors"
	"io"
)
var (
	ErrObjectNotFound = errors.New("object not found")
	ErrInvalidType = errors.New("invalid object type")
)
type EncodedObject interface {
	Hash() Hash
	Type() ObjectType
	SetType(ObjectType)
	Size() int64
	SetSize(int64)
	Reader() (io.ReadCloser, error)
	Writer() (io.WriteCloser, error)
}
type DeltaObject interface {
	EncodedObject
	BaseHash() Hash
	ActualHash() Hash
	ActualSize() int64
}
type ObjectType int8
const (
	InvalidObject ObjectType = 0
	CommitObject  ObjectType = 1
	TreeObject    ObjectType = 2
	BlobObject    ObjectType = 3
	TagObject     ObjectType = 4
	OFSDeltaObject ObjectType = 6
	REFDeltaObject ObjectType = 7
	AnyObject ObjectType = -127
)
func (t ObjectType) String() string {
	switch t {
	case CommitObject:
		return "commit"
	case TreeObject:
		return "tree"
	case BlobObject:
		return "blob"
	case TagObject:
		return "tag"
	case OFSDeltaObject:
		return "ofs-delta"
	case REFDeltaObject:
		return "ref-delta"
	case AnyObject:
		return "any"
	default:
		return "unknown"
	}
}
func (t ObjectType) Bytes() []byte {
	return []byte(t.String())
}