Documentation
¶
Index ¶
- Constants
- Variables
- func HashBlobBytes(b []byte) entities.Hash
- func HashBlobReader(size int64, r io.Reader) (entities.Hash, error)
- func HashBytes(b []byte) entities.Hash
- func HashFileBlob(fileName string) (entities.Hash, int64, error)
- func NewHasher() hash.Hash
- func ObjectJSONDecode(o JSONObject, magic ObjectType, hash Hash, content []byte) error
- func ObjectJSONEncode(o JSONObject, magic ObjectType) error
- func ParseHeader(buf []byte) (string, int64, error)
- func PrependHeaderReader(r io.Reader, objType string, size int64) io.Reader
- func PutHeader(objType string, content []byte) ([]byte, error)
- func ReadBlob(r io.Reader) ([]byte, error)
- func ReadBlobHeader(r io.Reader) (int64, error)
- func ReadHeader(r io.Reader) (string, int64, error)
- func WriteHeader(w io.Writer, objType string, size int64) error
- type DeepTreeRequest
- type Hash
- type JSONBaseObject
- type JSONObject
- type Object
- type ObjectType
Constants ¶
View Source
const ( CurrentDeepTreeRequestVersion = "0.2" ObjectTypeDeepTreeRequest entities.ObjectType = "deeptree-request" )
View Source
const MaxHeaderSize = 64
Variables ¶
View Source
var Factory factoryMap = make(factoryMap)
Functions ¶
func HashBlobBytes ¶
func ObjectJSONDecode ¶
func ObjectJSONDecode(o JSONObject, magic ObjectType, hash Hash, content []byte) error
func ObjectJSONEncode ¶
func ObjectJSONEncode(o JSONObject, magic ObjectType) error
func PrependHeaderReader ¶
func PutHeader ¶
PutHeader expects to receive an object type with the content of the object prefixed with a fixed header of MaxHeaderSize bytes. It will put the correct git header right before the actual content. It will return a slice where the actual content begins and includes the actual content.
Types ¶
type DeepTreeRequest ¶
type DeepTreeRequest struct {
JSONBaseObject
Version string
Tree Hash
}
func (*DeepTreeRequest) Encode ¶
func (e *DeepTreeRequest) Encode() error
func (*DeepTreeRequest) Links ¶
func (e *DeepTreeRequest) Links() []Hash
type JSONBaseObject ¶
func (*JSONBaseObject) Base ¶
func (o *JSONBaseObject) Base() *JSONBaseObject
func (*JSONBaseObject) GetEncoded ¶
func (o *JSONBaseObject) GetEncoded() []byte
func (*JSONBaseObject) GetHash ¶
func (o *JSONBaseObject) GetHash() Hash
type JSONObject ¶
type JSONObject interface {
Base() *JSONBaseObject
}
type ObjectType ¶
type ObjectType = entities.ObjectType
Click to show internal directories.
Click to hide internal directories.