packed

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package packed provides packfile reading and associated indexes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store reads Git objects from pack/index files under an objects/pack root.

Store owns root and closes it in Close.

func New

func New(root *os.Root, algo objectid.Algorithm) (*Store, error)

New creates a packed-object store rooted at an objects/pack directory.

func (*Store) Close

func (store *Store) Close() error

Close releases mapped pack/index resources associated with the store.

func (*Store) ReadBytesContent

func (store *Store) ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []byte, error)

ReadBytesContent reads an object's type and content bytes.

func (*Store) ReadBytesFull

func (store *Store) ReadBytesFull(id objectid.ObjectID) ([]byte, error)

ReadBytesFull reads a full serialized object as "type size\0content".

func (*Store) ReadHeader

func (store *Store) ReadHeader(id objectid.ObjectID) (objecttype.Type, int64, error)

ReadHeader reads an object's type and declared content size.

func (*Store) ReadReaderContent

func (store *Store) ReadReaderContent(id objectid.ObjectID) (objecttype.Type, int64, io.ReadCloser, error)

ReadReaderContent reads an object's type, declared content size, and content stream.

The caller must close the returned reader.

func (*Store) ReadReaderFull

func (store *Store) ReadReaderFull(id objectid.ObjectID) (io.ReadCloser, error)

ReadReaderFull reads a full serialized object stream as "type size\0content".

The caller must close the returned reader.

func (*Store) ReadSize added in v0.1.28

func (store *Store) ReadSize(id objectid.ObjectID) (int64, error)

ReadSize reads an object's declared content size.

Jump to

Keyboard shortcuts

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