Documentation
¶
Overview ¶
Package gitpack reads git pack files and v2 pack indexes by ranged reads.
Index ¶
- Constants
- Variables
- type Object
- type Pack
- func (p *Pack) Bind(r ReaderAt) *Pack
- func (p *Pack) Bytes() int
- func (p *Pack) CachedBytes() int
- func (p *Pack) Count() int
- func (p *Pack) Get(s SHA) (Type, []byte, error)
- func (p *Pack) GetDepth(s SHA) (Type, []byte, int, error)
- func (p *Pack) Has(s SHA) bool
- func (p *Pack) OnCacheChange(f func())
- func (p *Pack) Size(s SHA) (int64, Type, error)
- func (p *Pack) Verify(ctx context.Context, idx, pack []byte) error
- type ReaderAt
- type SHA
- type Type
Constants ¶
const (
MaxObjectBytes = 16 << 20
)
Variables ¶
var ( ErrCorrupt = errors.New("gitpack: corrupt pack or index") ErrTooLarge = errors.New("gitpack: object too large") )
var ErrNotFound = errors.New("object not found")
Functions ¶
This section is empty.
Types ¶
type Pack ¶
type Pack struct {
// contains filtered or unexported fields
}
func NewPack ¶
NewPack checks the structure and the checksum of a v2 index before it trusts a byte of it.
func (*Pack) Bind ¶
Bind returns a view of the pack that reads through r and shares its index and object cache, so a request can bring its own context to the reads.
func (*Pack) CachedBytes ¶
CachedBytes is the size of the resolved objects the pack holds.
func (*Pack) GetDepth ¶
GetDepth is Get that also returns the length of the delta chain that produced the object; zero is a whole object.
func (*Pack) OnCacheChange ¶
func (p *Pack) OnCacheChange(f func())
OnCacheChange sets f to run, with no lock held, after an object enters the cache. Call it before the pack is shared.