Documentation ¶
Index ¶
- type Hash
- type Object
- type ObjectStorage
- type ObjectType
- type PermanentError
- type RAWObject
- func (o *RAWObject) Hash() Hash
- func (o *RAWObject) Reader() io.Reader
- func (o *RAWObject) SetSize(s int64)
- func (o *RAWObject) SetType(t ObjectType)
- func (o *RAWObject) Size() int64
- func (o *RAWObject) Type() ObjectType
- func (o *RAWObject) Write(p []byte) (n int, err error)
- func (o *RAWObject) Writer() io.Writer
- type RAWObjectStorage
- type UnexpectedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hash ¶
type Hash [20]byte
Hash SHA1 hased content
func ComputeHash ¶
func ComputeHash(t ObjectType, content []byte) Hash
ComputeHash compute the hash for a given ObjectType and content
type Object ¶
type Object interface { Type() ObjectType SetType(ObjectType) Size() int64 SetSize(int64) Hash() Hash Reader() io.Reader Writer() io.Writer }
Object is a generic representation of any git object
type ObjectStorage ¶
ObjectStorage generic storage of objects
type ObjectType ¶
type ObjectType int8
ObjectType internal object type's
const ( CommitObject ObjectType = 1 TreeObject ObjectType = 2 BlobObject ObjectType = 3 TagObject ObjectType = 4 OFSDeltaObject ObjectType = 6 REFDeltaObject ObjectType = 7 )
func (ObjectType) Bytes ¶
func (t ObjectType) Bytes() []byte
func (ObjectType) String ¶
func (t ObjectType) String() string
type PermanentError ¶
type PermanentError struct {
Err error
}
func NewPermanentError ¶
func NewPermanentError(err error) *PermanentError
func (*PermanentError) Error ¶
func (e *PermanentError) Error() string
type RAWObject ¶
type RAWObject struct {
// contains filtered or unexported fields
}
func (*RAWObject) SetType ¶
func (o *RAWObject) SetType(t ObjectType)
func (*RAWObject) Type ¶
func (o *RAWObject) Type() ObjectType
type RAWObjectStorage ¶
type RAWObjectStorage struct { Objects map[Hash]Object Commits map[Hash]Object Trees map[Hash]Object Blobs map[Hash]Object }
func NewRAWObjectStorage ¶
func NewRAWObjectStorage() *RAWObjectStorage
func (*RAWObjectStorage) New ¶
func (o *RAWObjectStorage) New() Object
func (*RAWObjectStorage) Set ¶
func (o *RAWObjectStorage) Set(obj Object) Hash
type UnexpectedError ¶
type UnexpectedError struct {
Err error
}
func NewUnexpectedError ¶
func NewUnexpectedError(err error) *UnexpectedError
func (*UnexpectedError) Error ¶
func (e *UnexpectedError) Error() string
Click to show internal directories.
Click to hide internal directories.