This repository has been archived by the owner on Mar 5, 2022. It is now read-only.
/
opstoreprovider.gen.go
103 lines (92 loc) · 3.06 KB
/
opstoreprovider.gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Code generated by counterfeiter. DO NOT EDIT.
package mocks
import (
"sync"
"github.com/trustbloc/sidetree-fabric/pkg/context/common"
)
type OperationStoreProvider struct {
ForNamespaceStub func(namespace string) (common.OperationStore, error)
forNamespaceMutex sync.RWMutex
forNamespaceArgsForCall []struct {
namespace string
}
forNamespaceReturns struct {
result1 common.OperationStore
result2 error
}
forNamespaceReturnsOnCall map[int]struct {
result1 common.OperationStore
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *OperationStoreProvider) ForNamespace(namespace string) (common.OperationStore, error) {
fake.forNamespaceMutex.Lock()
ret, specificReturn := fake.forNamespaceReturnsOnCall[len(fake.forNamespaceArgsForCall)]
fake.forNamespaceArgsForCall = append(fake.forNamespaceArgsForCall, struct {
namespace string
}{namespace})
fake.recordInvocation("ForNamespace", []interface{}{namespace})
fake.forNamespaceMutex.Unlock()
if fake.ForNamespaceStub != nil {
return fake.ForNamespaceStub(namespace)
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.forNamespaceReturns.result1, fake.forNamespaceReturns.result2
}
func (fake *OperationStoreProvider) ForNamespaceCallCount() int {
fake.forNamespaceMutex.RLock()
defer fake.forNamespaceMutex.RUnlock()
return len(fake.forNamespaceArgsForCall)
}
func (fake *OperationStoreProvider) ForNamespaceArgsForCall(i int) string {
fake.forNamespaceMutex.RLock()
defer fake.forNamespaceMutex.RUnlock()
return fake.forNamespaceArgsForCall[i].namespace
}
func (fake *OperationStoreProvider) ForNamespaceReturns(result1 common.OperationStore, result2 error) {
fake.ForNamespaceStub = nil
fake.forNamespaceReturns = struct {
result1 common.OperationStore
result2 error
}{result1, result2}
}
func (fake *OperationStoreProvider) ForNamespaceReturnsOnCall(i int, result1 common.OperationStore, result2 error) {
fake.ForNamespaceStub = nil
if fake.forNamespaceReturnsOnCall == nil {
fake.forNamespaceReturnsOnCall = make(map[int]struct {
result1 common.OperationStore
result2 error
})
}
fake.forNamespaceReturnsOnCall[i] = struct {
result1 common.OperationStore
result2 error
}{result1, result2}
}
func (fake *OperationStoreProvider) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.forNamespaceMutex.RLock()
defer fake.forNamespaceMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *OperationStoreProvider) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ common.OperationStoreProvider = new(OperationStoreProvider)