1 Star 0 Fork 0

妥協/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
inspector.go 2.97 KB
一键复制 编辑 原始数据 按行查看 历史
Will Lahti 提交于 2018-11-26 16:56 . Instrument deliver service
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
context "context"
sync "sync"
proto "github.com/golang/protobuf/proto"
deliver "github.com/hyperledger/fabric/common/deliver"
)
type Inspector struct {
InspectStub func(context.Context, proto.Message) error
inspectMutex sync.RWMutex
inspectArgsForCall []struct {
arg1 context.Context
arg2 proto.Message
}
inspectReturns struct {
result1 error
}
inspectReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *Inspector) Inspect(arg1 context.Context, arg2 proto.Message) error {
fake.inspectMutex.Lock()
ret, specificReturn := fake.inspectReturnsOnCall[len(fake.inspectArgsForCall)]
fake.inspectArgsForCall = append(fake.inspectArgsForCall, struct {
arg1 context.Context
arg2 proto.Message
}{arg1, arg2})
fake.recordInvocation("Inspect", []interface{}{arg1, arg2})
fake.inspectMutex.Unlock()
if fake.InspectStub != nil {
return fake.InspectStub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.inspectReturns
return fakeReturns.result1
}
func (fake *Inspector) InspectCallCount() int {
fake.inspectMutex.RLock()
defer fake.inspectMutex.RUnlock()
return len(fake.inspectArgsForCall)
}
func (fake *Inspector) InspectCalls(stub func(context.Context, proto.Message) error) {
fake.inspectMutex.Lock()
defer fake.inspectMutex.Unlock()
fake.InspectStub = stub
}
func (fake *Inspector) InspectArgsForCall(i int) (context.Context, proto.Message) {
fake.inspectMutex.RLock()
defer fake.inspectMutex.RUnlock()
argsForCall := fake.inspectArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *Inspector) InspectReturns(result1 error) {
fake.inspectMutex.Lock()
defer fake.inspectMutex.Unlock()
fake.InspectStub = nil
fake.inspectReturns = struct {
result1 error
}{result1}
}
func (fake *Inspector) InspectReturnsOnCall(i int, result1 error) {
fake.inspectMutex.Lock()
defer fake.inspectMutex.Unlock()
fake.InspectStub = nil
if fake.inspectReturnsOnCall == nil {
fake.inspectReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.inspectReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *Inspector) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.inspectMutex.RLock()
defer fake.inspectMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *Inspector) 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 _ deliver.Inspector = new(Inspector)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liurenhao/fabric.git
git@gitee.com:liurenhao/fabric.git
liurenhao
fabric
fabric
v1.4.5

搜索帮助

0d507c66 1850385 C8b1a773 1850385