fastgit

package
v0.1.23-oss Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WritePackIndex

func WritePackIndex(idx *IndexFile, w io.Writer, packChecksum Hash) error

Types

type FindObjectResult

type FindObjectResult struct {
	Offset int64
	CRC    uint32
	Index  int
}

type Hash

type Hash = entities.Hash

type IndexFile

type IndexFile struct {
	ObjectCount   int
	ObjectMap     []map[Hash]int
	ObjectCRCs    []uint32
	ObjectOffsets []int64
	PackChecksum  Hash
	IndexChecksum Hash
}

IndexFile holds the parsed data from a .idx file

func NewIndexFile

func NewIndexFile() *IndexFile

func ParseIndex

func ParseIndex(buf []byte) (*IndexFile, error)

func ParseIndexFile

func ParseIndexFile(filePath string) (idx *IndexFile, retErr error)

func (*IndexFile) FindObject

func (idx *IndexFile) FindObject(oid Hash) (result FindObjectResult, found bool)

type ObjectType

type ObjectType uint8
const (
	ObjectCommit   ObjectType = 1
	ObjectTree     ObjectType = 2
	ObjectBlob     ObjectType = 3
	ObjectTag      ObjectType = 4
	ObjectOfsDelta ObjectType = 6
	ObjectRefDelta ObjectType = 7
)

func (ObjectType) String

func (t ObjectType) String() string

type Pack

type Pack struct {
	// contains filtered or unexported fields
}

func (*Pack) Close

func (p *Pack) Close() error

func (*Pack) OpenObject

func (p *Pack) OpenObject(oid Hash) (io.ReadCloser, error)

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func Open

func Open(repoPath string) (*Repository, error)

func (*Repository) Close

func (r *Repository) Close() error

func (*Repository) OpenObject

func (r *Repository) OpenObject(oid Hash) (io.ReadCloser, error)

type ResolvedObject

type ResolvedObject struct {
	Type ObjectType
	Data []byte
}

Jump to

Keyboard shortcuts

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