package
0.0.0-20220328024126-2ee2aa9d18c6
Repository: https://github.com/nivl/git-go.git
Documentation: pkg.go.dev
# Functions
NewFromFile returns a pack object from the given file The pack will need to be closed using Close().
NewIndex returns an index object from the given reader.
# Variables
ErrIntOverflow is an error thrown when the packfile couldn't be parsed because some data couldn't fit in an int64.
ErrInvalidMagic is an error thrown when a file doesn't have the expected magic.
ErrInvalidObjectSize represents a object which size doesn't match the expected size.
ErrInvalidVersion is an error thrown when a file has an unsupported version.
nolint // the linter expects all errors to start with Err, but since here we're faking an error we don't want that.
# Structs
Pack represents a Packfile The packfile contains a header, a content, and a footer Header: 12 bytes The first 4 bytes contain the magic ('P', 'A', 'C', 'K') The next 4 bytes contains the version (0, 0, 0, 2) The last 4 bytes contains the number of objects in the packfile Content: Variable size The content contains all the objects of the packfile, each zlib compressed.
PackIndex represents a packfile's PackIndex file (.idx) The index contains data to help parsing the packfile The index contains a header, 5 layers, and a footer.
# Type aliases
OidWalkFunc represents a function that will be apply on all oid found by Walk().