Documentation ¶
Index ¶
- Variables
- type ConfigStorage
- type EncodedObjectIter
- type IndexStorage
- type ModuleStorage
- type ObjectStorage
- func (o *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)
- func (o *ObjectStorage) EncodedObjectSize(h plumbing.Hash) (int64, error)
- func (o *ObjectStorage) HasEncodedObject(h plumbing.Hash) error
- func (o *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error)
- func (o *ObjectStorage) NewEncodedObject() plumbing.EncodedObject
- func (o *ObjectStorage) Objects() ([]plumbing.Hash, error)
- func (o *ObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)
- type ReferenceStorage
- func (r *ReferenceStorage) CheckAndSetReference(ref, 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(n plumbing.ReferenceName) (*plumbing.Reference, error)
- func (r *ReferenceStorage) References() ([]*plumbing.Reference, error)
- func (r *ReferenceStorage) RemoveReference(n plumbing.ReferenceName) error
- func (r *ReferenceStorage) SetReference(ref *plumbing.Reference) error
- type ShallowStorage
- type Storage
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedObjectType = errors.New("unsupported object type")
Functions ¶
This section is empty.
Types ¶
type ConfigStorage ¶
type ConfigStorage struct {
// contains filtered or unexported fields
}
type EncodedObjectIter ¶
type EncodedObjectIter struct {
// contains filtered or unexported fields
}
EncodedObjectIter looks up objects by hash.
func (*EncodedObjectIter) Close ¶
func (iter *EncodedObjectIter) Close()
func (*EncodedObjectIter) ForEach ¶
func (iter *EncodedObjectIter) ForEach(cb func(plumbing.EncodedObject) error) error
func (*EncodedObjectIter) Next ¶
func (iter *EncodedObjectIter) Next() (plumbing.EncodedObject, error)
type IndexStorage ¶
type IndexStorage struct {
// contains filtered or unexported fields
}
type ModuleStorage ¶
type ModuleStorage struct {
// contains filtered or unexported fields
}
func NewModuleStorage ¶
func NewModuleStorage(fs *unixfs.Unixfs) ModuleStorage
type ObjectStorage ¶
type ObjectStorage struct {
// contains filtered or unexported fields
}
func NewObjectStorage ¶
func NewObjectStorage(fs *unixfs.Unixfs) ObjectStorage
func (*ObjectStorage) EncodedObject ¶
func (o *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error)
EncodedObject gets an object by hash with the given plumbing.ObjectType. Implementors should return (nil, plumbing.ErrObjectNotFound) if an object doesn't exist with both the given hash and object type.
Valid plumbing.ObjectType values are CommitObject, BlobObject, TagObject, TreeObject and AnyObject. If plumbing.AnyObject is given, the object must be looked up regardless of its type.
func (*ObjectStorage) EncodedObjectSize ¶
func (o *ObjectStorage) EncodedObjectSize(h plumbing.Hash) (int64, error)
EncodedObjectSize returns the plaintext size of the encoded object.
func (*ObjectStorage) HasEncodedObject ¶
func (o *ObjectStorage) HasEncodedObject(h plumbing.Hash) error
HasEncodedObject returns ErrObjNotFound if the object doesn't exist. If the object does exist, it returns nil.
func (*ObjectStorage) IterEncodedObjects ¶
func (o *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error)
IterObjects returns a custom EncodedObjectStorer over all the object on the storage.
Valid plumbing.ObjectType values are CommitObject, BlobObject, TagObject,
func (*ObjectStorage) NewEncodedObject ¶
func (o *ObjectStorage) NewEncodedObject() plumbing.EncodedObject
NewEncodedObject returns a new plumbing.EncodedObject, the real type of the object can be a custom implementation or the default one, plumbing.MemoryObject.
func (*ObjectStorage) Objects ¶
func (o *ObjectStorage) Objects() ([]plumbing.Hash, error)
Objects returns a list of all object hashes.
func (*ObjectStorage) SetEncodedObject ¶
func (o *ObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error)
SetEncodedObject saves an object into the storage, the object should be create with the NewEncodedObject, method, and file if the type is not supported.
type ReferenceStorage ¶
type ReferenceStorage struct {
// contains filtered or unexported fields
}
func NewReferenceStorage ¶
func NewReferenceStorage(fs *unixfs.Unixfs) ReferenceStorage
func (*ReferenceStorage) CheckAndSetReference ¶
func (r *ReferenceStorage) CheckAndSetReference(ref, old *plumbing.Reference) error
CheckAndSetReference sets the reference `new`, but if `old` is not `nil`, it first checks that the current stored value for `old.Name()` matches the given reference value in `old`. If not, it returns an error and doesn't update `new`.
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 (r *ReferenceStorage) Reference(n plumbing.ReferenceName) (*plumbing.Reference, error)
func (*ReferenceStorage) References ¶
func (r *ReferenceStorage) References() ([]*plumbing.Reference, error)
func (*ReferenceStorage) RemoveReference ¶
func (r *ReferenceStorage) RemoveReference(n plumbing.ReferenceName) error
func (*ReferenceStorage) SetReference ¶
func (r *ReferenceStorage) SetReference(ref *plumbing.Reference) error
type ShallowStorage ¶
func (*ShallowStorage) SetShallow ¶
func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error
type Storage ¶
type Storage struct { ConfigStorage ObjectStorage ShallowStorage IndexStorage ReferenceStorage ModuleStorage // contains filtered or unexported fields }
Storage is an implementation of git.Storer