packfile

package
v0.0.0-...-4ff9f1c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Object types in packfile
	OBJ_COMMIT = 1
	OBJ_TREE   = 2
	OBJ_BLOB   = 3
	OBJ_TAG    = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader reads objects from a packfile.

func NewReader

func NewReader(data []byte) (*Reader, error)

NewReader creates a new packfile reader.

func (*Reader) ReadObject

func (r *Reader) ReadObject() (objType int, data []byte, err error)

ReadObject reads the next object from the packfile.

type Writer

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

Writer writes a packfile.

func NewWriter

func NewWriter() *Writer

NewWriter creates a new packfile writer.

func (*Writer) AddObject

func (w *Writer) AddObject(objType int, data []byte) error

AddObject adds an object to the packfile.

func (*Writer) Finalize

func (w *Writer) Finalize() []byte

Finalize completes the packfile and returns the data.

Jump to

Keyboard shortcuts

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