Documentation
¶
Overview ¶
Package memory is a storage backend base on memory
Index ¶
- Variables
- type ConfigStorage
- type IndexStorage
- type ModuleStorage
- type ObjectStorage
- func (o *ObjectStorage) Begin() storer.Transaction
- func (o *ObjectStorage) DeleteLooseObject(plumbing.Hash) error
- func (o *ObjectStorage) DeleteOldObjectPackAndIndex(plumbing.Hash, time.Time) error
- func (o *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)
- func (o *ObjectStorage) EncodedObjectSize(h plumbing.Hash) (size int64, err error)
- func (o *ObjectStorage) ForEachObjectHash(fun func(plumbing.Hash) error) error
- func (o *ObjectStorage) HasEncodedObject(h plumbing.Hash) (err error)
- func (o *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error)
- func (o *ObjectStorage) LooseObjectTime(hash plumbing.Hash) (time.Time, error)
- func (o *ObjectStorage) NewEncodedObject() plumbing.EncodedObject
- func (o *ObjectStorage) ObjectPacks() ([]plumbing.Hash, error)
- func (o *ObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)
- 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
- type TxObjectStorage
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedObjectType = fmt.Errorf("unsupported object type")
Functions ¶
This section is empty.
Types ¶
type ConfigStorage ¶
type ConfigStorage struct {
// contains filtered or unexported fields
}
type IndexStorage ¶
type IndexStorage struct {
// contains filtered or unexported fields
}
type ModuleStorage ¶
type ObjectStorage ¶
type ObjectStorage struct {
Objects *sync.Map // map[plumbing.Hash]plumbing.EncodedObject
Commits *sync.Map // map[plumbing.Hash]plumbing.EncodedObject
Trees *sync.Map // map[plumbing.Hash]plumbing.EncodedObject
Blobs *sync.Map // map[plumbing.Hash]plumbing.EncodedObject
Tags *sync.Map // map[plumbing.Hash]plumbing.EncodedObject
}
func (*ObjectStorage) Begin ¶
func (o *ObjectStorage) Begin() storer.Transaction
func (*ObjectStorage) DeleteLooseObject ¶
func (o *ObjectStorage) DeleteLooseObject(plumbing.Hash) error
func (*ObjectStorage) DeleteOldObjectPackAndIndex ¶
func (*ObjectStorage) EncodedObject ¶
func (o *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)
func (*ObjectStorage) EncodedObjectSize ¶
func (o *ObjectStorage) EncodedObjectSize(h plumbing.Hash) ( size int64, err error)
func (*ObjectStorage) ForEachObjectHash ¶
func (o *ObjectStorage) ForEachObjectHash(fun func(plumbing.Hash) error) error
func (*ObjectStorage) HasEncodedObject ¶
func (o *ObjectStorage) HasEncodedObject(h plumbing.Hash) (err error)
func (*ObjectStorage) IterEncodedObjects ¶
func (o *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error)
func (*ObjectStorage) LooseObjectTime ¶
func (*ObjectStorage) NewEncodedObject ¶
func (o *ObjectStorage) NewEncodedObject() plumbing.EncodedObject
func (*ObjectStorage) ObjectPacks ¶
func (o *ObjectStorage) ObjectPacks() ([]plumbing.Hash, error)
func (*ObjectStorage) SetEncodedObject ¶
func (o *ObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)
type ReferenceStorage ¶
type ReferenceStorage struct {
// contains filtered or unexported fields
}
ReferenceStorage stores references safely for concurrent access. Its zero value is ready to use. A ReferenceStorage must not be copied after first use.
func (*ReferenceStorage) CheckAndSetReference ¶
func (r *ReferenceStorage) CheckAndSetReference(ref, old *plumbing.Reference) error
func (*ReferenceStorage) CountLooseRefs ¶
func (r *ReferenceStorage) CountLooseRefs() (int, error)
CountLooseRefs counts references observed during iteration. Concurrent updates may change the count while the iteration is in progress.
func (*ReferenceStorage) IterReferences ¶
func (r *ReferenceStorage) IterReferences() (storer.ReferenceIter, error)
IterReferences collects references into an independent iterator. Concurrent updates may be reflected in the collection; it is not a consistent snapshot.
func (*ReferenceStorage) PackRefs ¶
func (r *ReferenceStorage) PackRefs() 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 ¶
func (*ShallowStorage) SetShallow ¶
func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error
type Storage ¶
type Storage struct {
ConfigStorage
ObjectStorage
ShallowStorage
IndexStorage
*ReferenceStorage
ModuleStorage
}
Storage is an implementation of git.Storer that stores data on memory, being ephemeral. The use of this storage should be done in controlled environments, since the representation in memory of some repository can fill the machine memory. in the other hand this storage has the best performance.
type TxObjectStorage ¶
type TxObjectStorage struct {
Storage *ObjectStorage
Objects map[plumbing.Hash]plumbing.EncodedObject
}
func (*TxObjectStorage) Commit ¶
func (tx *TxObjectStorage) Commit() error
func (*TxObjectStorage) EncodedObject ¶
func (tx *TxObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)
func (*TxObjectStorage) Rollback ¶
func (tx *TxObjectStorage) Rollback() error
func (*TxObjectStorage) SetEncodedObject ¶
func (tx *TxObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)