Documentation ¶
Overview ¶
Package storage is an SQL-backed storage implementation for go-git.
Index ¶
- type ObjectStorage
- func (o *ObjectStorage) AddAlternate(remote string) error
- func (o *ObjectStorage) EncodedObject(objType plumbing.ObjectType, objHash plumbing.Hash) (plumbing.EncodedObject, error)
- func (o *ObjectStorage) EncodedObjectSize(hash plumbing.Hash) (int64, error)
- func (o *ObjectStorage) HasEncodedObject(hash plumbing.Hash) error
- func (o *ObjectStorage) IterEncodedObjects(objType plumbing.ObjectType) (storer.EncodedObjectIter, error)
- func (o *ObjectStorage) NewEncodedObject() plumbing.EncodedObject
- func (o *ObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)
- type ReferenceStorage
- func (r *ReferenceStorage) CheckAndSetReference(new, old *plumbing.Reference) error
- func (r *ReferenceStorage) CountLooseRefs() (int, error)
- func (r *ReferenceStorage) IterReferences() (storer.ReferenceIter, error)
- func (r *ReferenceStorage) PackRefs() error
- func (r *ReferenceStorage) Reference(name plumbing.ReferenceName) (*plumbing.Reference, error)
- func (r *ReferenceStorage) RemoveReference(name plumbing.ReferenceName) error
- func (r *ReferenceStorage) SetReference(ref *plumbing.Reference) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectStorage ¶
type ObjectStorage struct {
// contains filtered or unexported fields
}
func (*ObjectStorage) AddAlternate ¶
func (o *ObjectStorage) AddAlternate(remote string) error
AddAlternate is not currently implemented.
func (*ObjectStorage) EncodedObject ¶
func (o *ObjectStorage) EncodedObject(objType plumbing.ObjectType, objHash plumbing.Hash) (plumbing.EncodedObject, error)
EncodedObject returns the object with the specified hash and matching object type. If AnyObject is passed as the object type, only the object hash will be used in this lookup.
func (*ObjectStorage) EncodedObjectSize ¶
func (o *ObjectStorage) EncodedObjectSize(hash plumbing.Hash) (int64, error)
EncodedObjectSize returns the size of the contents stored against the object with the specified hash.
func (*ObjectStorage) HasEncodedObject ¶
func (o *ObjectStorage) HasEncodedObject(hash plumbing.Hash) error
HasEncodedObject checks if an object with the specified hash exists, returning nil if the object does exist, and an error if it does not.
func (*ObjectStorage) IterEncodedObjects ¶
func (o *ObjectStorage) IterEncodedObjects(objType plumbing.ObjectType) (storer.EncodedObjectIter, error)
IterEncodedObjects returns an iterator that traverses all of the available objects of the specified type.
func (*ObjectStorage) NewEncodedObject ¶
func (o *ObjectStorage) NewEncodedObject() plumbing.EncodedObject
NewEncodedObject returns a new copy of the default plumbing.MemoryObject.
func (*ObjectStorage) SetEncodedObject ¶
func (o *ObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)
SetEncodedObject stores the object provided.
If the object contents cannot be read, or the object fails to be written to the database, a ZeroHash will be returned with the appropriate wrapped error.
type ReferenceStorage ¶
type ReferenceStorage struct {
// contains filtered or unexported fields
}
func (*ReferenceStorage) CheckAndSetReference ¶
func (r *ReferenceStorage) CheckAndSetReference(new, old *plumbing.Reference) error
func (*ReferenceStorage) CountLooseRefs ¶
func (r *ReferenceStorage) CountLooseRefs() (int, error)
func (*ReferenceStorage) IterReferences ¶
func (r *ReferenceStorage) IterReferences() (storer.ReferenceIter, error)
IterReferences returns an iterator capable of walking through all available Git references.
func (*ReferenceStorage) PackRefs ¶
func (r *ReferenceStorage) PackRefs() error
PackRefs is not currently implemented.
func (*ReferenceStorage) Reference ¶
func (r *ReferenceStorage) Reference(name plumbing.ReferenceName) (*plumbing.Reference, error)
Reference loads a Git reference from storage.
func (*ReferenceStorage) RemoveReference ¶
func (r *ReferenceStorage) RemoveReference(name plumbing.ReferenceName) error
RemoveReference deletes a Git reference from storage by its unique name.
func (*ReferenceStorage) SetReference ¶
func (r *ReferenceStorage) SetReference(ref *plumbing.Reference) error
SetReference writes a Git reference to storage.
type Storage ¶
type Storage struct { ObjectStorage ReferenceStorage // The following structs are duplicated from the go-git memory storage // implementation, however they are omitted from the declaration below. memory.ConfigStorage memory.IndexStorage memory.ModuleStorage memory.ShallowStorage }
func NewStorage ¶
NewStorage creates a new SQL-backed storage interface.