Versions in this module Expand all Collapse all v2 v2.1.0 Aug 22, 2022 Changes in this version + const VersionSupported + var ErrMalformedIdxFile = errors.New("malformed IDX file") + var ErrUnsupportedVersion = errors.New("unsupported version") + type Decoder struct + func NewDecoder(r io.Reader) *Decoder + func (d *Decoder) Decode(idx *MemoryIndex) error + type Encoder struct + func NewEncoder(w io.Writer) *Encoder + func (e *Encoder) Encode(idx *MemoryIndex) (int, error) + type Entry struct + CRC32 uint32 + Hash plumbing.Hash + Offset uint64 + type EntryIter interface + Close func() error + Next func() (*Entry, error) + type Index interface + Contains func(h plumbing.Hash) (bool, error) + Count func() (int64, error) + Entries func() (EntryIter, error) + EntriesByOffset func() (EntryIter, error) + FindCRC32 func(h plumbing.Hash) (uint32, error) + FindHash func(o int64) (plumbing.Hash, error) + FindOffset func(h plumbing.Hash) (int64, error) + type MemoryIndex struct + CRC32 [][]byte + Fanout [256]uint32 + FanoutMapping [256]int + IdxChecksum [20]byte + Names [][]byte + Offset32 [][]byte + Offset64 []byte + PackfileChecksum [20]byte + Version uint32 + func NewMemoryIndex() *MemoryIndex + func (idx *MemoryIndex) Contains(h plumbing.Hash) (bool, error) + func (idx *MemoryIndex) Count() (int64, error) + func (idx *MemoryIndex) Entries() (EntryIter, error) + func (idx *MemoryIndex) EntriesByOffset() (EntryIter, error) + func (idx *MemoryIndex) FindCRC32(h plumbing.Hash) (uint32, error) + func (idx *MemoryIndex) FindHash(o int64) (plumbing.Hash, error) + func (idx *MemoryIndex) FindOffset(h plumbing.Hash) (int64, error) + type Writer struct + func (w *Writer) Add(h plumbing.Hash, pos uint64, crc uint32) + func (w *Writer) Finished() bool + func (w *Writer) Index() (*MemoryIndex, error) + func (w *Writer) OnFooter(h plumbing.Hash) error + func (w *Writer) OnHeader(count uint32) error + func (w *Writer) OnInflatedObjectContent(h plumbing.Hash, pos int64, crc uint32, _ []byte) error + func (w *Writer) OnInflatedObjectHeader(t plumbing.ObjectType, objSize int64, pos int64) error