go-git: github.com/go-git/go-git/storage/memory Index | Files

package memory

import "github.com/go-git/go-git/storage/memory"

Package memory is a storage backend base on memory


Package Files



var ErrUnsupportedObjectType = fmt.Errorf("unsupported object type")

type ConfigStorage Uses

type ConfigStorage struct {
    // contains filtered or unexported fields

func (*ConfigStorage) Config Uses

func (c *ConfigStorage) Config() (*config.Config, error)

func (*ConfigStorage) SetConfig Uses

func (c *ConfigStorage) SetConfig(cfg *config.Config) error

type IndexStorage Uses

type IndexStorage struct {
    // contains filtered or unexported fields

func (*IndexStorage) Index Uses

func (c *IndexStorage) Index() (*index.Index, error)

func (*IndexStorage) SetIndex Uses

func (c *IndexStorage) SetIndex(idx *index.Index) error

type ModuleStorage Uses

type ModuleStorage map[string]*Storage

func (ModuleStorage) Module Uses

func (s ModuleStorage) Module(name string) (storage.Storer, error)

type ObjectStorage Uses

type ObjectStorage struct {
    Objects map[plumbing.Hash]plumbing.EncodedObject
    Commits map[plumbing.Hash]plumbing.EncodedObject
    Trees   map[plumbing.Hash]plumbing.EncodedObject
    Blobs   map[plumbing.Hash]plumbing.EncodedObject
    Tags    map[plumbing.Hash]plumbing.EncodedObject

func (*ObjectStorage) Begin Uses

func (o *ObjectStorage) Begin() storer.Transaction

func (*ObjectStorage) DeleteLooseObject Uses

func (o *ObjectStorage) DeleteLooseObject(plumbing.Hash) error

func (*ObjectStorage) DeleteOldObjectPackAndIndex Uses

func (o *ObjectStorage) DeleteOldObjectPackAndIndex(plumbing.Hash, time.Time) error

func (*ObjectStorage) EncodedObject Uses

func (o *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)

func (*ObjectStorage) EncodedObjectSize Uses

func (o *ObjectStorage) EncodedObjectSize(h plumbing.Hash) (
    size int64, err error)

func (*ObjectStorage) ForEachObjectHash Uses

func (o *ObjectStorage) ForEachObjectHash(fun func(plumbing.Hash) error) error

func (*ObjectStorage) HasEncodedObject Uses

func (o *ObjectStorage) HasEncodedObject(h plumbing.Hash) (err error)

func (*ObjectStorage) IterEncodedObjects Uses

func (o *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error)

func (*ObjectStorage) LooseObjectTime Uses

func (o *ObjectStorage) LooseObjectTime(hash plumbing.Hash) (time.Time, error)

func (*ObjectStorage) NewEncodedObject Uses

func (o *ObjectStorage) NewEncodedObject() plumbing.EncodedObject

func (*ObjectStorage) ObjectPacks Uses

func (o *ObjectStorage) ObjectPacks() ([]plumbing.Hash, error)

func (*ObjectStorage) SetEncodedObject Uses

func (o *ObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)

type ReferenceStorage Uses

type ReferenceStorage map[plumbing.ReferenceName]*plumbing.Reference

func (ReferenceStorage) CheckAndSetReference Uses

func (r ReferenceStorage) CheckAndSetReference(ref, old *plumbing.Reference) error

func (ReferenceStorage) CountLooseRefs Uses

func (r ReferenceStorage) CountLooseRefs() (int, error)

func (ReferenceStorage) IterReferences Uses

func (r ReferenceStorage) IterReferences() (storer.ReferenceIter, error)

func (ReferenceStorage) PackRefs Uses

func (r ReferenceStorage) PackRefs() error

func (ReferenceStorage) Reference Uses

func (r ReferenceStorage) Reference(n plumbing.ReferenceName) (*plumbing.Reference, error)

func (ReferenceStorage) RemoveReference Uses

func (r ReferenceStorage) RemoveReference(n plumbing.ReferenceName) error

func (ReferenceStorage) SetReference Uses

func (r ReferenceStorage) SetReference(ref *plumbing.Reference) error

type ShallowStorage Uses

type ShallowStorage []plumbing.Hash

func (*ShallowStorage) SetShallow Uses

func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error

func (ShallowStorage) Shallow Uses

func (s ShallowStorage) Shallow() ([]plumbing.Hash, error)

type Storage Uses

type Storage struct {

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.

func NewStorage Uses

func NewStorage() *Storage

NewStorage returns a new Storage base on memory

type TxObjectStorage Uses

type TxObjectStorage struct {
    Storage *ObjectStorage
    Objects map[plumbing.Hash]plumbing.EncodedObject

func (*TxObjectStorage) Commit Uses

func (tx *TxObjectStorage) Commit() error

func (*TxObjectStorage) EncodedObject Uses

func (tx *TxObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)

func (*TxObjectStorage) Rollback Uses

func (tx *TxObjectStorage) Rollback() error

func (*TxObjectStorage) SetEncodedObject Uses

func (tx *TxObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)

Package memory imports 7 packages (graph). Updated 2020-07-14. Refresh now. Tools for package owners.