Documentation ¶
Overview ¶
Package memory is a storage backend base on memory
Index ¶
- Variables
- type ConfigStorage
- type ObjectStorage
- func (o *ObjectStorage) Begin() core.TxObjectStorage
- func (o *ObjectStorage) Get(t core.ObjectType, h core.Hash) (core.Object, error)
- func (o *ObjectStorage) Iter(t core.ObjectType) (core.ObjectIter, error)
- func (o *ObjectStorage) NewObject() core.Object
- func (o *ObjectStorage) Set(obj core.Object) (core.Hash, error)
- type ReferenceStorage
- type Storage
- type TxObjectStorage
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ConfigStorage ¶
type ConfigStorage struct {
RemotesConfig map[string]*config.RemoteConfig
}
func (*ConfigStorage) DeleteRemote ¶
func (c *ConfigStorage) DeleteRemote(name string) error
func (*ConfigStorage) Remote ¶
func (c *ConfigStorage) Remote(name string) (*config.RemoteConfig, error)
func (*ConfigStorage) Remotes ¶
func (c *ConfigStorage) Remotes() ([]*config.RemoteConfig, error)
func (*ConfigStorage) SetRemote ¶
func (c *ConfigStorage) SetRemote(r *config.RemoteConfig) error
type ObjectStorage ¶
type ObjectStorage struct { Objects map[core.Hash]core.Object Commits map[core.Hash]core.Object Trees map[core.Hash]core.Object Blobs map[core.Hash]core.Object Tags map[core.Hash]core.Object }
ObjectStorage is the implementation of core.ObjectStorage for memory.Object
func (*ObjectStorage) Begin ¶
func (o *ObjectStorage) Begin() core.TxObjectStorage
func (*ObjectStorage) Get ¶
func (o *ObjectStorage) Get(t core.ObjectType, h core.Hash) (core.Object, error)
Get returns a object with the given hash
func (*ObjectStorage) Iter ¶
func (o *ObjectStorage) Iter(t core.ObjectType) (core.ObjectIter, error)
Iter returns a core.ObjectIter for the given core.ObjectTybe
func (*ObjectStorage) NewObject ¶
func (o *ObjectStorage) NewObject() core.Object
NewObject creates a new MemoryObject
type ReferenceStorage ¶
type ReferenceStorage map[core.ReferenceName]*core.Reference
func (ReferenceStorage) Get ¶
func (r ReferenceStorage) Get(n core.ReferenceName) (*core.Reference, error)
Get returns a stored reference with the given name
func (ReferenceStorage) Iter ¶
func (r ReferenceStorage) Iter() (core.ReferenceIter, error)
Iter returns a core.ReferenceIter
func (ReferenceStorage) Set ¶
func (r ReferenceStorage) Set(ref *core.Reference) error
Set stores a reference.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage in memory storage system
func (*Storage) ConfigStorage ¶
func (s *Storage) ConfigStorage() config.ConfigStorage
ConfigStorage return the ConfigStorage, if not exists create a new one
func (*Storage) ObjectStorage ¶
func (s *Storage) ObjectStorage() core.ObjectStorage
ObjectStorage returns the ObjectStorage, if not exists creates a new one
func (*Storage) ReferenceStorage ¶
func (s *Storage) ReferenceStorage() core.ReferenceStorage
ReferenceStorage returns the ReferenceStorage if not exists creates a new one
type TxObjectStorage ¶
type TxObjectStorage struct { Storage *ObjectStorage Objects map[core.Hash]core.Object }
func (*TxObjectStorage) Commit ¶
func (tx *TxObjectStorage) Commit() error
func (*TxObjectStorage) Get ¶
func (tx *TxObjectStorage) Get(t core.ObjectType, h core.Hash) (core.Object, error)
func (*TxObjectStorage) Rollback ¶
func (tx *TxObjectStorage) Rollback() error
Click to show internal directories.
Click to hide internal directories.