go-git.v4: gopkg.in/src-d/go-git.v4/storage/transactional Index | Files

package transactional

import "gopkg.in/src-d/go-git.v4/storage/transactional"

Package transactional is a transactional implementation of git.Storer, it demux the write and read operation of two separate storers, allowing to merge content calling Storage.Commit.

The API and functionality of this package are considered EXPERIMENTAL and is not considered stable nor production ready.

Index

Package Files

config.go doc.go index.go object.go reference.go shallow.go storage.go

type ConfigStorage Uses

type ConfigStorage struct {
    config.ConfigStorer
    // contains filtered or unexported fields
}

ConfigStorage implements the storer.ConfigStorage for the transactional package.

func NewConfigStorage Uses

func NewConfigStorage(s, temporal config.ConfigStorer) *ConfigStorage

NewConfigStorage returns a new ConfigStorer based on a base storer and a temporal storer.

func (*ConfigStorage) Commit Uses

func (c *ConfigStorage) Commit() error

Commit it copies the config from the temporal storage into the base storage.

func (*ConfigStorage) Config Uses

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

Config honors the storer.ConfigStorer interface.

func (*ConfigStorage) SetConfig Uses

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

SetConfig honors the storer.ConfigStorer interface.

type IndexStorage Uses

type IndexStorage struct {
    storer.IndexStorer
    // contains filtered or unexported fields
}

IndexStorage implements the storer.IndexStorage for the transactional package.

func NewIndexStorage Uses

func NewIndexStorage(s, temporal storer.IndexStorer) *IndexStorage

NewIndexStorage returns a new IndexStorer based on a base storer and a temporal storer.

func (*IndexStorage) Commit Uses

func (s *IndexStorage) Commit() error

Commit it copies the index from the temporal storage into the base storage.

func (*IndexStorage) Index Uses

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

Index honors the storer.IndexStorer interface.

func (*IndexStorage) SetIndex Uses

func (s *IndexStorage) SetIndex(idx *index.Index) (err error)

SetIndex honors the storer.IndexStorer interface.

type ObjectStorage Uses

type ObjectStorage struct {
    storer.EncodedObjectStorer
    // contains filtered or unexported fields
}

ObjectStorage implements the storer.EncodedObjectStorer for the transactional package.

func NewObjectStorage Uses

func NewObjectStorage(base, temporal storer.EncodedObjectStorer) *ObjectStorage

NewObjectStorage returns a new EncodedObjectStorer based on a base storer and a temporal storer.

func (*ObjectStorage) Commit Uses

func (o *ObjectStorage) Commit() error

Commit it copies the objects of the temporal storage into the base storage.

func (*ObjectStorage) EncodedObject Uses

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

EncodedObject honors the storer.EncodedObjectStorer interface.

func (*ObjectStorage) EncodedObjectSize Uses

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

EncodedObjectSize honors the storer.EncodedObjectStorer interface.

func (*ObjectStorage) HasEncodedObject Uses

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

HasEncodedObject honors the storer.EncodedObjectStorer interface.

func (*ObjectStorage) IterEncodedObjects Uses

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

IterEncodedObjects honors the storer.EncodedObjectStorer interface.

func (*ObjectStorage) SetEncodedObject Uses

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

SetEncodedObject honors the storer.EncodedObjectStorer interface.

type ReferenceStorage Uses

type ReferenceStorage struct {
    storer.ReferenceStorer
    // contains filtered or unexported fields
}

ReferenceStorage implements the storer.ReferenceStorage for the transactional package.

func NewReferenceStorage Uses

func NewReferenceStorage(base, temporal storer.ReferenceStorer) *ReferenceStorage

NewReferenceStorage returns a new ReferenceStorer based on a base storer and a temporal storer.

func (*ReferenceStorage) CheckAndSetReference Uses

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

SetReference honors the storer.ReferenceStorer interface.

func (ReferenceStorage) Commit Uses

func (r ReferenceStorage) Commit() error

Commit it copies the reference information of the temporal storage into the base storage.

func (ReferenceStorage) CountLooseRefs Uses

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

CountLooseRefs honors the storer.ReferenceStorer interface.

func (ReferenceStorage) IterReferences Uses

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

IterReferences honors the storer.ReferenceStorer interface.

func (ReferenceStorage) PackRefs Uses

func (r ReferenceStorage) PackRefs() error

PackRefs honors the storer.ReferenceStorer interface.

func (ReferenceStorage) Reference Uses

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

Reference honors the storer.ReferenceStorer interface.

func (ReferenceStorage) RemoveReference Uses

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

RemoveReference honors the storer.ReferenceStorer interface.

func (*ReferenceStorage) SetReference Uses

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

SetReference honors the storer.ReferenceStorer interface.

type ShallowStorage Uses

type ShallowStorage struct {
    storer.ShallowStorer
    // contains filtered or unexported fields
}

ShallowStorage implements the storer.ShallowStorer for the transactional package.

func NewShallowStorage Uses

func NewShallowStorage(base, temporal storer.ShallowStorer) *ShallowStorage

NewShallowStorage returns a new ShallowStorage based on a base storer and a temporal storer.

func (*ShallowStorage) Commit Uses

func (s *ShallowStorage) Commit() error

Commit it copies the shallow information of the temporal storage into the base storage.

func (*ShallowStorage) SetShallow Uses

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

SetShallow honors the storer.ShallowStorer interface.

func (*ShallowStorage) Shallow Uses

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

Shallow honors the storer.ShallowStorer interface.

type Storage Uses

type Storage interface {
    storage.Storer
    Commit() error
}

Storage is a transactional implementation of git.Storer, it demux the write and read operation of two separate storers, allowing to merge content calling Storage.Commit.

The API and functionality of this package are considered EXPERIMENTAL and is not considered stable nor production ready.

func NewStorage Uses

func NewStorage(base, temporal storage.Storer) Storage

NewStorage returns a new Storage based on two repositories, base is the base repository where the read operations are read and temporal is were all the write operations are stored.

Package transactional imports 6 packages (graph) and is imported by 2 packages. Updated 2019-08-04. Refresh now. Tools for package owners.