filesystem
packageThis package is not in the latest version of its module.
Details
Valid go.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package filesystem is a storage backend base on filesystems
Index¶
- func NewPackfileIter(fs billy.Filesystem, f billy.File, idxFile billy.File, t plumbing.ObjectType) (storer.EncodedObjectIter, error)
- type ConfigStorage
- type IndexStorage
- type ModuleStorage
- type ObjectStorage
- func (s *ObjectStorage) Close() error
- func (s *ObjectStorage) DeleteLooseObject(hash plumbing.Hash) error
- func (s *ObjectStorage) DeleteOldObjectPackAndIndex(h plumbing.Hash, t time.Time) error
- 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) ForEachObjectHash(fun func(plumbing.Hash) error) error
- func (s *ObjectStorage) HasEncodedObject(h plumbing.Hash) (err error)
- func (s *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error)
- func (s *ObjectStorage) LooseObjectTime(hash plumbing.Hash) (time.Time, error)
- func (s *ObjectStorage) NewEncodedObject() plumbing.EncodedObject
- func (s *ObjectStorage) ObjectPacks() ([]plumbing.Hash, error)
- func (s *ObjectStorage) PackfileWriter() (io.WriteCloser, error)
- func (s *ObjectStorage) SetEncodedObject(o plumbing.EncodedObject) (h plumbing.Hash, err error)
- type Options
- type ReferenceStorage
- func (r *ReferenceStorage) CheckAndSetReference(ref, old *plumbing.Reference) error
- func (r *ReferenceStorage) CountLooseRefs() (int, error)
- func (r *ReferenceStorage) IterReferences() (storer.ReferenceIter, error)
- func (r *ReferenceStorage) PackRefs() 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¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcNewPackfileIter¶
func NewPackfileIter(fsbilly.Filesystem,fbilly.File,idxFilebilly.File,tplumbing.ObjectType,) (storer.EncodedObjectIter,error)
NewPackfileIter returns a new EncodedObjectIter for the provided packfileand object type. Packfile and index file will be closed after they'reused.
Types¶
typeConfigStorage¶
type ConfigStorage struct {// contains filtered or unexported fields}typeIndexStorage¶
type IndexStorage struct {// contains filtered or unexported fields}typeModuleStorage¶
type ModuleStorage struct {// contains filtered or unexported fields}typeObjectStorage¶
type ObjectStorage struct {// contains filtered or unexported fields}funcNewObjectStorage¶
func NewObjectStorage(dir *dotgit.DotGit) (ObjectStorage,error)
NewObjectStorage creates a new ObjectStorage with the given .git directory.
funcNewObjectStorageWithOptions¶
func NewObjectStorageWithOptions(dir *dotgit.DotGit,opsOptions,) (ObjectStorage,error)
NewObjectStorageWithOptions creates a new ObjectStorage with the given .gitdirectory and sets its options.
func (*ObjectStorage)DeleteLooseObject¶
func (s *ObjectStorage) DeleteLooseObject(hashplumbing.Hash)error
func (*ObjectStorage)DeleteOldObjectPackAndIndex¶
func (*ObjectStorage)DeltaObject¶
func (s *ObjectStorage) DeltaObject(tplumbing.ObjectType,hplumbing.Hash) (plumbing.EncodedObject,error)
DeltaObject returns the object with the given hash, by searching forit in the packfile and the git object directories.
func (*ObjectStorage)EncodedObject¶
func (s *ObjectStorage) EncodedObject(tplumbing.ObjectType, hplumbing.Hash) (plumbing.EncodedObject,error)
EncodedObject returns the object with the given hash, by searching for it inthe packfile and the git object directories.
func (*ObjectStorage)ForEachObjectHash¶
func (s *ObjectStorage) ForEachObjectHash(fun func(plumbing.Hash)error)error
func (*ObjectStorage)HasEncodedObject¶
func (s *ObjectStorage) HasEncodedObject(hplumbing.Hash) (errerror)
HasEncodedObject returns nil if the object exists, without actuallyreading the object data from storage.
func (*ObjectStorage)IterEncodedObjects¶
func (s *ObjectStorage) IterEncodedObjects(tplumbing.ObjectType) (storer.EncodedObjectIter,error)
IterEncodedObjects returns an iterator for all the objects in the packfilewith the given type.
func (*ObjectStorage)LooseObjectTime¶
func (*ObjectStorage)NewEncodedObject¶
func (s *ObjectStorage) NewEncodedObject()plumbing.EncodedObject
func (*ObjectStorage)ObjectPacks¶
func (s *ObjectStorage) ObjectPacks() ([]plumbing.Hash,error)
func (*ObjectStorage)PackfileWriter¶
func (s *ObjectStorage) PackfileWriter() (io.WriteCloser,error)
func (*ObjectStorage)SetEncodedObject¶
func (s *ObjectStorage) SetEncodedObject(oplumbing.EncodedObject) (hplumbing.Hash, errerror)
SetEncodedObject adds a new object to the storage.
typeOptions¶
type Options struct {// ExclusiveAccess means that the filesystem is not modified externally// while the repo is open.ExclusiveAccessbool// KeepDescriptors makes the file descriptors to be reused but they will// need to be manually closed calling Close().KeepDescriptorsbool}Options holds configuration for the storage.
typeReferenceStorage¶
type ReferenceStorage struct {// contains filtered or unexported fields}func (*ReferenceStorage)CheckAndSetReference¶
func (r *ReferenceStorage) CheckAndSetReference(ref, old *plumbing.Reference)error
func (*ReferenceStorage)CountLooseRefs¶
func (r *ReferenceStorage) CountLooseRefs() (int,error)
func (*ReferenceStorage)IterReferences¶
func (r *ReferenceStorage) IterReferences() (storer.ReferenceIter,error)
func (*ReferenceStorage)PackRefs¶
func (r *ReferenceStorage) PackRefs()error
func (*ReferenceStorage)Reference¶
func (r *ReferenceStorage) Reference(nplumbing.ReferenceName) (*plumbing.Reference,error)
func (*ReferenceStorage)RemoveReference¶
func (r *ReferenceStorage) RemoveReference(nplumbing.ReferenceName)error
func (*ReferenceStorage)SetReference¶
func (r *ReferenceStorage) SetReference(ref *plumbing.Reference)error
typeShallowStorage¶
type ShallowStorage struct {// contains filtered or unexported fields}ShallowStorage where the shallow commits are stored, an internal tomanipulate 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 onecommit per line represented by 40-byte hexadecimal object terminated by anewline.
typeStorage¶
type Storage struct {ObjectStorageReferenceStorageIndexStorageShallowStorageConfigStorageModuleStorage// contains filtered or unexported fields}Storage is an implementation of git.Storer that stores data on disk in thestandard git format (this is, the .git directory). Zero values of this typeare not safe to use, see the NewStorage function below.
funcNewStorage¶
func NewStorage(fsbilly.Filesystem) (*Storage,error)
NewStorage returns a new Storage backed by a given `fs.Filesystem`
funcNewStorageWithOptions¶
func NewStorageWithOptions(fsbilly.Filesystem,opsOptions,) (*Storage,error)
NewStorageWithOptions returns a new Storage backed by a given `fs.Filesystem`
func (*Storage)Filesystem¶
func (s *Storage) Filesystem()billy.Filesystem
Filesystem returns the underlying filesystem