Debian Codegraph @

storage/transactional/object.go

raw symbols SCIP
1 package transactionalscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/
2
3 import (
4 "gopkg.in/src-d/go-git.v4/plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/"
5 "gopkg.in/src-d/go-git.v4/plumbing/storerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/"
6 )
7
8 // ObjectStorage implements the storer.EncodedObjectStorer for the transactional package.
9 type ObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage# struct {
10 storerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/.EncodedObjectStorerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#EncodedObjectStorer.
11 temporalscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#temporal. storerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/.EncodedObjectStorerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#
12 }
13
14 // NewObjectStorage returns a new EncodedObjectStorer based on a base storer and
15 // a temporal storer.
16 func NewObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/NewObjectStorage().(base, temporal storerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/.EncodedObjectStorerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#) *ObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage# {
17 return &ObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#{EncodedObjectStorerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#EncodedObjectStorer.: base, temporalscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#temporal.: temporal}
18 }
19
20 // SetEncodedObject honors the storer.EncodedObjectStorer interface.
21 func (o *ObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#) SetEncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#SetEncodedObject().(obj plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.EncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/EncodedObject#) (plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.Hashscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/Hash#, error) {
22 return o.temporalscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#temporal..SetEncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#SetEncodedObject.(obj)
23 }
24
25 // HasEncodedObject honors the storer.EncodedObjectStorer interface.
26 func (o *ObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#) HasEncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#HasEncodedObject().(h plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.Hashscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/Hash#) error {
27 err := o.EncodedObjectStorerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#EncodedObjectStorer..HasEncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#HasEncodedObject.(h)
28 if err == plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.ErrObjectNotFoundscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/ErrObjectNotFound. {
29 return o.temporalscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#temporal..HasEncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#HasEncodedObject.(h)
30 }
31
32 return err
33 }
34
35 // EncodedObjectSize honors the storer.EncodedObjectStorer interface.
36 func (o *ObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#) EncodedObjectSizescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#EncodedObjectSize().(h plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.Hashscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/Hash#) (int64, error) {
37 sz, err := o.EncodedObjectStorerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#EncodedObjectStorer..EncodedObjectSizescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#EncodedObjectSize.(h)
38 if err == plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.ErrObjectNotFoundscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/ErrObjectNotFound. {
39 return o.temporalscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#temporal..EncodedObjectSizescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#EncodedObjectSize.(h)
40 }
41
42 return sz, err
43 }
44
45 // EncodedObject honors the storer.EncodedObjectStorer interface.
46 func (o *ObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#) EncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#EncodedObject().(t plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.ObjectTypescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/ObjectType#, h plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.Hashscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/Hash#) (plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.EncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/EncodedObject#, error) {
47 obj, err := o.EncodedObjectStorerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#EncodedObjectStorer..EncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#EncodedObject.(t, h)
48 if err == plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.ErrObjectNotFoundscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/ErrObjectNotFound. {
49 return o.temporalscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#temporal..EncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#EncodedObject.(t, h)
50 }
51
52 return obj, err
53 }
54
55 // IterEncodedObjects honors the storer.EncodedObjectStorer interface.
56 func (o *ObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#) IterEncodedObjectsscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#IterEncodedObjects().(t plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.ObjectTypescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/ObjectType#) (storerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/.EncodedObjectIterscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectIter#, error) {
57 baseIter, err := o.EncodedObjectStorerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#EncodedObjectStorer..IterEncodedObjectsscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#IterEncodedObjects.(t)
58 if err != nil {
59 return nil, err
60 }
61
62 temporalIter, err := o.temporalscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#temporal..IterEncodedObjectsscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#IterEncodedObjects.(t)
63 if err != nil {
64 return nil, err
65 }
66
67 return storerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/.NewMultiEncodedObjectIterscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/NewMultiEncodedObjectIter().([]storerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/.EncodedObjectIterscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectIter#{
68 baseIter,
69 temporalIter,
70 }), nil
71 }
72
73 // Commit it copies the objects of the temporal storage into the base storage.
74 func (o *ObjectStoragescip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#) Commitscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#Commit().() error {
75 iter, err := o.temporalscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#temporal..IterEncodedObjectsscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#IterEncodedObjects.(plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.AnyObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/AnyObject.)
76 if err != nil {
77 return err
78 }
79
80 return iter.ForEachscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectIter#ForEach.(func(obj plumbingscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/.EncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing`/EncodedObject#) error {
81 _, err := o.EncodedObjectStorerscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/storage/transactional`/ObjectStorage#EncodedObjectStorer..SetEncodedObjectscip-go gomod gopkg.in/src-d/go-git.v4 . `gopkg.in/src-d/go-git.v4/plumbing/storer`/EncodedObjectStorer#SetEncodedObject.(obj)
82 return err
83 })
84 }