Documentation ¶
Overview ¶
Package filesystem is a storage backend base on filesystems
Index ¶
- Constants
- func NewPackfileIter(f billy.File, t plumbing.ObjectType) (storer.EncodedObjectIter, error)
- type ConfigStorage
- type IndexStorage
- type ModuleStorage
- type ObjectStorage
- func (s *ObjectStorage) DeltaObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)
- func (s *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)
- func (s *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error)
- func (s *ObjectStorage) NewEncodedObject() plumbing.EncodedObject
- func (s *ObjectStorage) PackfileWriter() (io.WriteCloser, error)
- func (s *ObjectStorage) SetEncodedObject(o plumbing.EncodedObject) (plumbing.Hash, error)
- type ReferenceStorage
- func (r *ReferenceStorage) IterReferences() (storer.ReferenceIter, error)
- func (r *ReferenceStorage) Reference(n plumbing.ReferenceName) (*plumbing.Reference, error)
- func (r *ReferenceStorage) RemoveReference(n plumbing.ReferenceName) error
- func (r *ReferenceStorage) SetReference(ref *plumbing.Reference) error
- type ShallowStorage
- type Storage
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func NewPackfileIter ¶
func NewPackfileIter(f billy.File, t plumbing.ObjectType) (storer.EncodedObjectIter, error)
Types ¶
type ConfigStorage ¶
type ConfigStorage struct {
// contains filtered or unexported fields
}
func (*ConfigStorage) Config ¶
func (c *ConfigStorage) Config() (*config.Config, error)
func (*ConfigStorage) SetConfig ¶
func (c *ConfigStorage) SetConfig(cfg *config.Config) error
type IndexStorage ¶
type IndexStorage struct {
// contains filtered or unexported fields
}
func (*IndexStorage) Index ¶
func (s *IndexStorage) Index() (*index.Index, error)
func (*IndexStorage) SetIndex ¶
func (s *IndexStorage) SetIndex(idx *index.Index) error
type ModuleStorage ¶
type ModuleStorage struct {
// contains filtered or unexported fields
}
type ObjectStorage ¶
type ObjectStorage struct { // DeltaBaseCache is an object cache uses to cache delta's bases when DeltaBaseCache cache.Object // contains filtered or unexported fields }
func (*ObjectStorage) DeltaObject ¶
func (s *ObjectStorage) DeltaObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)
DeltaObject returns the object with the given hash, by searching for it in the packfile and the git object directories.
func (*ObjectStorage) EncodedObject ¶
func (s *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)
EncodedObject returns the object with the given hash, by searching for it in the packfile and the git object directories.
func (*ObjectStorage) IterEncodedObjects ¶
func (s *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error)
IterEncodedObjects returns an iterator for all the objects in the packfile with the given type.
func (*ObjectStorage) NewEncodedObject ¶
func (s *ObjectStorage) NewEncodedObject() plumbing.EncodedObject
func (*ObjectStorage) PackfileWriter ¶
func (s *ObjectStorage) PackfileWriter() (io.WriteCloser, error)
func (*ObjectStorage) SetEncodedObject ¶
func (s *ObjectStorage) SetEncodedObject(o plumbing.EncodedObject) (plumbing.Hash, error)
SetEncodedObject adds a new object to the storage.
type ReferenceStorage ¶
type ReferenceStorage struct {
// contains filtered or unexported fields
}
func (*ReferenceStorage) IterReferences ¶
func (r *ReferenceStorage) IterReferences() (storer.ReferenceIter, error)
func (*ReferenceStorage) Reference ¶
func (r *ReferenceStorage) Reference(n plumbing.ReferenceName) (*plumbing.Reference, error)
func (*ReferenceStorage) RemoveReference ¶
func (r *ReferenceStorage) RemoveReference(n plumbing.ReferenceName) error
func (*ReferenceStorage) SetReference ¶
func (r *ReferenceStorage) SetReference(ref *plumbing.Reference) error
type ShallowStorage ¶
type ShallowStorage struct {
// contains filtered or unexported fields
}
ShallowStorage where the shallow commits are stored, an internal to manipulate the shallow file
func (*ShallowStorage) SetShallow ¶
func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error
SetShallow save the shallows in the shallow file in the .git folder as one commit per line represented by 40-byte hexadecimal object terminated by a newline.
func (*ShallowStorage) Shallow ¶
func (s *ShallowStorage) Shallow() ([]plumbing.Hash, error)
Shallow return the shallow commits reading from shallo file from .git
type Storage ¶
type Storage struct { ObjectStorage ReferenceStorage IndexStorage ShallowStorage ConfigStorage ModuleStorage // contains filtered or unexported fields }
Storage is an implementation of git.Storer 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 NewStorage function below.
func NewStorage ¶
NewStorage returns a new Storage backed by a given `fs.Filesystem`