Version: v3.0.1 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2016 License: MIT Imports: 8 Imported by: 245




This section is empty.


View Source
var (
	EmptyRepositoryErr        = newError("empty repository")
	UnsupportedVersionErr     = newError("unsupported packfile version")
	MaxObjectsLimitReachedErr = newError("max. objects limit reached")
	MalformedPackfileErr      = newError("malformed pack file, does not start with 'PACK'")
	InvalidObjectErr          = newError("invalid git object")
	PatchingErr               = newError("patching error")
	PackEntryNotFoundErr      = newError("can't find a pack entry")
	ObjectNotFoundErr         = newError("can't find a object")
	ZLibErr                   = newError("zlib reading error")


func NewTrackingReader

func NewTrackingReader(r io.Reader) *trackingReader


type Format

type Format int
const (
	DefaultMaxObjectsLimit = 1 << 20

	VersionSupported        = 2
	UnknownFormat    Format = 0
	OFSDeltaFormat   Format = 1
	REFDeltaFormat   Format = 2

type Reader

type Reader struct {
	// MaxObjectsLimit is the limit of objects to be load in the packfile, if
	// a packfile excess this number an error is throw, the default value
	// is defined by DefaultMaxObjectsLimit, usually the default limit is more
	// than enough to work with any repository, working extremly big repositories
	// where the number of object is bigger the memory can be exhausted.
	MaxObjectsLimit uint32

	// Format specifies if we are using ref-delta's or ofs-delta's, choosing the
	// correct format the memory usage is optimized
	Format Format
	// contains filtered or unexported fields

Reader reads a packfile from a binary string splitting it on objects

func NewReader

func NewReader(r io.Reader) *Reader

NewReader returns a new Reader that reads from a io.Reader

func (*Reader) Read

func (r *Reader) Read(s core.ObjectStorage) (int64, error)

Read reads the objects and stores it at the ObjectStorage

type ReaderError

type ReaderError struct {
	// contains filtered or unexported fields

func (*ReaderError) Error

func (e *ReaderError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL