seekable

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2016 License: MIT Imports: 8 Imported by: 0

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

func (s *ObjectStorage) Get(h core.Hash) (core.Object, error)

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

Iter returns an iterator for all the objects in the packfile with the given type.

func (*ObjectStorage) Set

func (s *ObjectStorage) Set(core.Object) (core.Hash, error)

Set adds a new object to the storage. As this functionality is not yet supported, this method always returns a "not implemented yet" error an zero hash.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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