Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectStorage ¶
type ObjectStorage struct {
// contains filtered or unexported fields
}
ObjectStorage is an implementation of core.ObjectStorage that stores data on disk in the standard git format (this is, the .git directory).
Zero values of this type are not safe to use, see the New function below.
Currently only reads are supported, no writting.
Also values from this type are not yet able to track changes on disk, this is, Gitdir values will get outdated as soon as repositories change on disk.
func New ¶
func New(fs fs.FS, path string) (*ObjectStorage, error)
New returns a new ObjectStorage for the git directory at the specified path.
func (*ObjectStorage) Get ¶
Get returns the object with the given hash, by searching for it in the packfile.
func (*ObjectStorage) Head ¶
func (s *ObjectStorage) Head() (core.Hash, error)
Head returns the hash of the HEAD reference
func (*ObjectStorage) Iter ¶
func (s *ObjectStorage) Iter(t core.ObjectType) (core.ObjectIter, error)
Iter returns an iterator for all the objects in the packfile with the given type.