Documentation ¶
Overview ¶
Package memory is a storage backend base on memory
Index ¶
- Variables
- type ConfigStorage
- type ObjectStorage
- func (o *ObjectStorage) Begin() storer.Transaction
- func (o *ObjectStorage) IterObjects(t plumbing.ObjectType) (storer.ObjectIter, error)
- func (o *ObjectStorage) NewObject() plumbing.Object
- func (o *ObjectStorage) Object(t plumbing.ObjectType, h plumbing.Hash) (plumbing.Object, error)
- func (o *ObjectStorage) SetObject(obj plumbing.Object) (plumbing.Hash, error)
- type ReferenceStorage
- type Storage
- type TxObjectStorage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedObjectType = fmt.Errorf("unsupported object type")
Functions ¶
This section is empty.
Types ¶
type ConfigStorage ¶
type ConfigStorage struct {
// contains filtered or unexported fields
}
type ObjectStorage ¶
type ObjectStorage struct { Objects map[plumbing.Hash]plumbing.Object Commits map[plumbing.Hash]plumbing.Object Trees map[plumbing.Hash]plumbing.Object Blobs map[plumbing.Hash]plumbing.Object Tags map[plumbing.Hash]plumbing.Object }
func (*ObjectStorage) Begin ¶
func (o *ObjectStorage) Begin() storer.Transaction
func (*ObjectStorage) IterObjects ¶
func (o *ObjectStorage) IterObjects(t plumbing.ObjectType) (storer.ObjectIter, error)
func (*ObjectStorage) NewObject ¶
func (o *ObjectStorage) NewObject() plumbing.Object
func (*ObjectStorage) Object ¶
func (o *ObjectStorage) Object(t plumbing.ObjectType, h plumbing.Hash) (plumbing.Object, error)
type ReferenceStorage ¶
type ReferenceStorage map[plumbing.ReferenceName]*plumbing.Reference
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) SetReference ¶
func (r ReferenceStorage) SetReference(ref *plumbing.Reference) error
type Storage ¶
type Storage struct { ConfigStorage ObjectStorage ReferenceStorage }
Storage is an implementation of git.Storer that stores data on memory, being ephemeral. The use of this storage should be done in controlled envoriments, 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.Object }
func (*TxObjectStorage) Commit ¶
func (tx *TxObjectStorage) Commit() error
func (*TxObjectStorage) Object ¶
func (tx *TxObjectStorage) Object(t plumbing.ObjectType, h plumbing.Hash) (plumbing.Object, error)
func (*TxObjectStorage) Rollback ¶
func (tx *TxObjectStorage) Rollback() error
Click to show internal directories.
Click to hide internal directories.