Documentation
¶
Overview ¶
Package loose provides a loose object backend (objects/XX/YYYYY..).
Index ¶
- type Store
- func (store *Store) Close() error
- func (store *Store) ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []byte, error)
- func (store *Store) ReadBytesFull(id objectid.ObjectID) ([]byte, error)
- func (store *Store) ReadHeader(id objectid.ObjectID) (objecttype.Type, int64, error)
- func (store *Store) ReadReaderContent(id objectid.ObjectID) (objecttype.Type, int64, io.ReadCloser, error)
- func (store *Store) ReadReaderFull(id objectid.ObjectID) (io.ReadCloser, error)
- func (store *Store) ReadSize(id objectid.ObjectID) (int64, error)
- func (store *Store) WriteBytesContent(ty objecttype.Type, content []byte) (objectid.ObjectID, error)
- func (store *Store) WriteBytesFull(raw []byte) (objectid.ObjectID, error)
- func (store *Store) WriteReaderContent(ty objecttype.Type, size int64, src io.Reader) (objectid.ObjectID, error)
- func (store *Store) WriteReaderFull(src io.Reader) (objectid.ObjectID, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads loose Git objects from an objects directory root.
Store owns root and closes it in Close.
func (*Store) ReadBytesContent ¶
ReadBytesContent reads an object's type and content bytes.
func (*Store) ReadBytesFull ¶
ReadBytesFull reads a full serialized object as "type size\0content".
func (*Store) ReadHeader ¶
ReadHeader reads an object's type and declared content length.
func (*Store) ReadReaderContent ¶
func (store *Store) ReadReaderContent(id objectid.ObjectID) (objecttype.Type, int64, io.ReadCloser, error)
ReadReaderContent reads an object's type, declared content length, and content stream. The caller must close the returned reader.
func (*Store) ReadReaderFull ¶
ReadReaderFull reads a full serialized object stream as "type size\0content". The caller must close the returned reader.
func (*Store) WriteBytesContent ¶
func (store *Store) WriteBytesContent(ty objecttype.Type, content []byte) (objectid.ObjectID, error)
WriteBytesContent writes typed content bytes as a loose object.
func (*Store) WriteBytesFull ¶
WriteBytesFull writes a full serialized object as "type size\0content".
func (*Store) WriteReaderContent ¶ added in v0.1.22
func (store *Store) WriteReaderContent(ty objecttype.Type, size int64, src io.Reader) (objectid.ObjectID, error)
WriteReaderContent writes one loose object from typed content bytes read from src. src must provide exactly size bytes. size is required because loose object headers are "type size\0content", so the header must be emitted before streaming content without buffering.