memory

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Overview

Package memory is a storage backend base on memory

Index

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
}

func (*ConfigStorage) Config

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

func (*ConfigStorage) SetConfig

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

type IndexStorage

type IndexStorage struct {
	// contains filtered or unexported fields
}

func (*IndexStorage) Index

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

func (*IndexStorage) SetIndex

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

type ModuleStorage

type ModuleStorage map[string]*Storage

func (ModuleStorage) Module

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

type ObjectStorage

func (*ObjectStorage) Begin

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

func (*ObjectStorage) DeleteLooseObject

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

func (*ObjectStorage) DeleteOldObjectPackAndIndex

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

func (*ObjectStorage) EncodedObject

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 (o *ObjectStorage) LooseObjectTime(hash plumbing.Hash) (time.Time, error)

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 map[plumbing.ReferenceName]*plumbing.Reference

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 (ReferenceStorage) RemoveReference

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

func (ReferenceStorage) SetReference

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

type ShallowStorage

type ShallowStorage []plumbing.Hash

func (*ShallowStorage) SetShallow

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

func (ShallowStorage) Shallow

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

type Storage

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

func NewStorage() *Storage

NewStorage returns a new Storage base on memory

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 (*TxObjectStorage) Rollback

func (tx *TxObjectStorage) Rollback() error

func (*TxObjectStorage) SetEncodedObject

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL