Documentation ¶
Index ¶
- Constants
- Variables
- func BuildIdxFile(fn string) (oerr error)
- func DefaultFromDir(dir string) error
- func DupObjectInFile(fn string) (oerr error)
- func Flush(m Packer) error
- func Footer(m Packer) error
- func GetOffsetNoClassify(idxf string) (op OriginPackFile, objs []ObjEntry, err error)
- func NewIdx(idxf string) (*idxfile.MemoryIndex, error)
- func Reidx(packf string) (hs string, err error)
- func TravelPackFile(fn string, cb func(o uint32, h [32]byte, s uint32, r io.ReadSeeker) error) (err error)
- type ByteClassify
- type Entries
- type FileFinder
- type FileMap
- type HashSelect
- type HeadOffset
- type Header
- type HeaderExt
- type IdxObj
- func (idx *IdxObj) BuildHead(o *ObjEntry) (head []byte, err error)
- func (idx *IdxObj) Close() error
- func (idx *IdxObj) GetBase(o *ObjEntry) (*ObjEntry, error)
- func (idx *IdxObj) Next(cb func(o *ObjEntry, h, b []byte) error) (err error)
- func (idx *IdxObj) Reset(v bool)
- func (idx *IdxObj) ResolveRealType(o *ObjEntry) error
- type MergeFile
- type MergeNoFile
- type ObjEntry
- type ObjectGet
- func (og *ObjectGet) Body(oh types.Hash) ([]byte, error)
- func (og *ObjectGet) Get(oh types.Hash) ([]byte, types.Hash, error)
- func (og *ObjectGet) Header() (*packfile.ObjectHeader, error)
- func (og *ObjectGet) HeaderByHash(oh types.Hash) (*packfile.ObjectHeader, error)
- func (og *ObjectGet) Reader() io.Reader
- type OriginPackFile
- type OriginPackFiles
- type PackEncodeFile
- func (pf *PackEncodeFile) Close() error
- func (pf *PackEncodeFile) Do(r io.Reader, size int64) (int64, error)
- func (pf *PackEncodeFile) DoBody(r io.Reader) (int64, error)
- func (pf *PackEncodeFile) DoHead(oh *packfile.ObjectHeader) (int64, error)
- func (pf *PackEncodeFile) Footer() (plumbing.Hash, error)
- func (pf *PackEncodeFile) Head(numEntries int) error
- type PackFile
- type PackFileAndDB
- type PackFiles
- type Packer
- type Packns
- func (r *Packns) Close() (err error)
- func (r *Packns) GetAnyHash(hash types.Hash) (body []byte, d bool, base [32]byte, err error)
- func (r *Packns) GetByHash(hash types.Hash) (head map[int][]HeadOffset, err error)
- func (r *Packns) GetHashAndLen(h [32]byte, head map[int][]HeadOffset) (body []byte, deta bool, base [32]byte, err error)
- func (r *Packns) GetRawByHash(hash types.Hash) (raw []byte, err error)
- func (r *Packns) GetRawSpecial(h [32]byte) (raw []byte, err error)
- func (r *Packns) GetSpecial(h [32]byte) (body []byte, d bool, base [32]byte, err error)
- type Scanner
- type SelectFile
- type Selector
- type SplitIdx
Constants ¶
View Source
const ( // VersionSupported is the packfile version supported by this package VersionSupported uint32 = 2 )
Variables ¶
View Source
var ( ErrSize = errors.New("Size Error") ErrMiss = errors.New("Miss") ErrKey = errors.New("Wrony Key Format") ErrBadName = errors.New("Bad Pack File Name") )
View Source
var DefaultOPS = NewOriginPackFiles()
View Source
var (
ErrOutSize = errors.New("Out of Size")
)
View Source
var (
ErrorNoFind = errors.New("No Find")
)
View Source
var MaxSelect maxSelect
View Source
var SortMode = "size"
Functions ¶
func BuildIdxFile ¶
func DefaultFromDir ¶
func DupObjectInFile ¶
func GetOffsetNoClassify ¶
func GetOffsetNoClassify(idxf string) (op OriginPackFile, objs []ObjEntry, err error)
func TravelPackFile ¶
Types ¶
type ByteClassify ¶
type ByteClassify byte
func (ByteClassify) NamePrefix ¶
func (b ByteClassify) NamePrefix() string
type HashSelect ¶
func (HashSelect) Determine ¶
func (hash HashSelect) Determine(objs []*ObjEntry) *ObjEntry
type HeadOffset ¶
type IdxObj ¶
type IdxObj struct {
// contains filtered or unexported fields
}
func (*IdxObj) ResolveRealType ¶
type MergeFile ¶
type MergeFile struct {
// contains filtered or unexported fields
}
func NewMergeFile ¶
type MergeNoFile ¶
type MergeNoFile struct {
// contains filtered or unexported fields
}
func NewMergeNoFile ¶
func NewMergeNoFile(dir string) (*MergeNoFile, error)
func (*MergeNoFile) AddFile ¶
func (m *MergeNoFile) AddFile(idxf string) error
func (*MergeNoFile) Close ¶
func (m *MergeNoFile) Close()
type ObjEntry ¶
type ObjEntry struct { idxfile.Entry Size uint32 PackFile OriginPackFile OHeader *packfile.ObjectHeader RealType plumbing.ObjectType }
func NewOEFromBytes ¶
func (*ObjEntry) ToHeaderExt ¶
type ObjectGet ¶
type ObjectGet struct {
// contains filtered or unexported fields
}
func NewObjectGet ¶
func NewObjectGet(g types.PackDataGeter) *ObjectGet
func (*ObjectGet) HeaderByHash ¶
type OriginPackFile ¶
func (OriginPackFile) Less ¶
func (a OriginPackFile) Less(b OriginPackFile) bool
func (OriginPackFile) NewEmptyEntry ¶
func (o OriginPackFile) NewEmptyEntry() *ObjEntry
func (OriginPackFile) String ¶
func (o OriginPackFile) String() string
type OriginPackFiles ¶
type OriginPackFiles struct {
// contains filtered or unexported fields
}
func NewOriginPackFiles ¶
func NewOriginPackFiles() OriginPackFiles
func (OriginPackFiles) GetFileName ¶
func (ops OriginPackFiles) GetFileName(hash OriginPackFile) (string, error)
func (OriginPackFiles) GetHash ¶
func (ops OriginPackFiles) GetHash(fn string) (OriginPackFile, error)
type PackEncodeFile ¶
type PackEncodeFile struct {
// contains filtered or unexported fields
}
func NewPack ¶
func NewPack(fn string) (*PackEncodeFile, error)
func (*PackEncodeFile) Close ¶
func (pf *PackEncodeFile) Close() error
func (*PackEncodeFile) DoHead ¶
func (pf *PackEncodeFile) DoHead(oh *packfile.ObjectHeader) (int64, error)
func (*PackEncodeFile) Head ¶
func (pf *PackEncodeFile) Head(numEntries int) error
type PackFileAndDB ¶
type PackFileAndDB struct {
// contains filtered or unexported fields
}
func NewFileDirPFDB ¶
func NewFileDirPFDB(db types.DBer, dir string) (*PackFileAndDB, error)
type PackFiles ¶
type PackFiles struct { Opened map[types.Hash]*PackFile MaxOpen int GetFileName FileFinder }
func NewPackFiles ¶
func NewPackFiles(finder FileFinder) *PackFiles
type Packns ¶
func (*Packns) GetAnyHash ¶
func (*Packns) GetHashAndLen ¶
func (*Packns) GetRawByHash ¶
type Scanner ¶
func NewScanner ¶
func (*Scanner) ObjectHeaderAtOffset ¶
func (s *Scanner) ObjectHeaderAtOffset(offset int64) (*packfile.ObjectHeader, error)
type SelectFile ¶
type SelectFile struct {
// contains filtered or unexported fields
}
func NewSelectFile ¶
func NewSelectFile(dir string, objs []string, g *ObjectGet) (*SelectFile, error)
func (*SelectFile) Close ¶
func (m *SelectFile) Close() error
func (*SelectFile) Dir ¶
func (m *SelectFile) Dir() string
func (*SelectFile) Do ¶
func (m *SelectFile) Do() (err error)
func (*SelectFile) Head ¶
func (m *SelectFile) Head() error
type SplitIdx ¶
func DefaultByteSplit ¶
func DefaultByteSplit() SplitIdx
Click to show internal directories.
Click to hide internal directories.