Versions in this module Expand all Collapse all v5 v5.1.1 Oct 6, 2020 Changes in this version + const VersionSupported + var ErrBadSignature = NewError("malformed pack file signature") + var ErrDeltaCmd = errors.New("wrong delta command") + var ErrDeltaNotCached = errors.New("delta could not be found in cache") + var ErrEmptyPackfile = NewError("empty packfile") + var ErrInvalidDelta = errors.New("invalid delta") + var ErrInvalidObject = NewError("invalid git object") + var ErrNotSeekableSource = errors.New("parser source is not seekable and storage was not provided") + var ErrReferenceDeltaNotFound = errors.New("reference delta not found") + var ErrSeekNotSupported = NewError("not seek support") + var ErrUnsupportedVersion = NewError("unsupported packfile version") + var ErrZLib = NewError("zlib reading error") + var T = []uint32 + func ApplyDelta(target, base plumbing.EncodedObject, delta []byte) (err error) + func DiffDelta(src, tgt []byte) []byte + func GetDelta(base, target plumbing.EncodedObject) (plumbing.EncodedObject, error) + func PatchDelta(src, delta []byte) ([]byte, error) + func UpdateObjectStorage(s storer.Storer, packfile io.Reader) error + func WritePackfileToObjectStorage(sw storer.PackfileWriter, packfile io.Reader) (err error) + type Encoder struct + func NewEncoder(w io.Writer, s storer.EncodedObjectStorer, useRefDeltas bool) *Encoder + func (e *Encoder) Encode(hashes []plumbing.Hash, packWindow uint) (plumbing.Hash, error) + type Error struct + func NewError(reason string) *Error + func (e *Error) AddDetails(format string, args ...interface{}) *Error + func (e *Error) Error() string + type FSObject struct + func NewFSObject(hash plumbing.Hash, finalType plumbing.ObjectType, offset int64, ...) *FSObject + func (o *FSObject) Hash() plumbing.Hash + func (o *FSObject) Reader() (io.ReadCloser, error) + func (o *FSObject) SetSize(int64) + func (o *FSObject) SetType(plumbing.ObjectType) + func (o *FSObject) Size() int64 + func (o *FSObject) Type() plumbing.ObjectType + func (o *FSObject) Writer() (io.WriteCloser, error) + type ObjectHeader struct + Length int64 + Offset int64 + OffsetReference int64 + Reference plumbing.Hash + Type plumbing.ObjectType + type ObjectToPack struct + Base *ObjectToPack + Depth int + Object plumbing.EncodedObject + Offset int64 + Original plumbing.EncodedObject + func (o *ObjectToPack) BackToOriginal() + func (o *ObjectToPack) CleanOriginal() + func (o *ObjectToPack) Hash() plumbing.Hash + func (o *ObjectToPack) IsDelta() bool + func (o *ObjectToPack) IsWritten() bool + func (o *ObjectToPack) MarkWantWrite() + func (o *ObjectToPack) SaveOriginalMetadata() + func (o *ObjectToPack) SetDelta(base *ObjectToPack, delta plumbing.EncodedObject) + func (o *ObjectToPack) SetOriginal(obj plumbing.EncodedObject) + func (o *ObjectToPack) Size() int64 + func (o *ObjectToPack) Type() plumbing.ObjectType + func (o *ObjectToPack) WantWrite() bool + type Observer interface + OnFooter func(h plumbing.Hash) error + OnHeader func(count uint32) error + OnInflatedObjectContent func(h plumbing.Hash, pos int64, crc uint32, content []byte) error + OnInflatedObjectHeader func(t plumbing.ObjectType, objSize int64, pos int64) error + type Packfile struct + func NewPackfile(index idxfile.Index, fs billy.Filesystem, file billy.File) *Packfile + func NewPackfileWithCache(index idxfile.Index, fs billy.Filesystem, file billy.File, cache cache.Object) *Packfile + func (p *Packfile) Close() error + func (p *Packfile) Get(h plumbing.Hash) (plumbing.EncodedObject, error) + func (p *Packfile) GetAll() (storer.EncodedObjectIter, error) + func (p *Packfile) GetByOffset(o int64) (plumbing.EncodedObject, error) + func (p *Packfile) GetByType(typ plumbing.ObjectType) (storer.EncodedObjectIter, error) + func (p *Packfile) GetSizeByOffset(o int64) (size int64, err error) + func (p *Packfile) ID() (plumbing.Hash, error) + func (p *Packfile) Scanner() *Scanner + type Parser struct + func NewParser(scanner *Scanner, ob ...Observer) (*Parser, error) + func NewParserWithStorage(scanner *Scanner, storage storer.EncodedObjectStorer, ob ...Observer) (*Parser, error) + func (p *Parser) Parse() (plumbing.Hash, error) + type Scanner struct + IsSeekable bool + func NewScanner(r io.Reader) *Scanner + func (s *Scanner) Checksum() (plumbing.Hash, error) + func (s *Scanner) Close() error + func (s *Scanner) Flush() error + func (s *Scanner) Header() (version, objects uint32, err error) + func (s *Scanner) NextObject(w io.Writer) (written int64, crc32 uint32, err error) + func (s *Scanner) NextObjectHeader() (*ObjectHeader, error) + func (s *Scanner) Reset(r io.Reader) + func (s *Scanner) SeekFromStart(offset int64) (previous int64, err error) + func (s *Scanner) SeekObjectHeader(offset int64) (*ObjectHeader, error) Other modules containing this package github.com/jesseduffield/go-git