63 Star 183 Fork 3

Gitee 极速下载/hyperledger-fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hyperledger/fabric
克隆/下载
response_sender.go 4.73 KB
一键复制 编辑 原始数据 按行查看 历史
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
"github.com/hyperledger/fabric/common/deliver"
cb "github.com/hyperledger/fabric/protos/common"
)
type ResponseSender struct {
SendStatusResponseStub func(status cb.Status) error
sendStatusResponseMutex sync.RWMutex
sendStatusResponseArgsForCall []struct {
status cb.Status
}
sendStatusResponseReturns struct {
result1 error
}
sendStatusResponseReturnsOnCall map[int]struct {
result1 error
}
SendBlockResponseStub func(block *cb.Block) error
sendBlockResponseMutex sync.RWMutex
sendBlockResponseArgsForCall []struct {
block *cb.Block
}
sendBlockResponseReturns struct {
result1 error
}
sendBlockResponseReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *ResponseSender) SendStatusResponse(status cb.Status) error {
fake.sendStatusResponseMutex.Lock()
ret, specificReturn := fake.sendStatusResponseReturnsOnCall[len(fake.sendStatusResponseArgsForCall)]
fake.sendStatusResponseArgsForCall = append(fake.sendStatusResponseArgsForCall, struct {
status cb.Status
}{status})
fake.recordInvocation("SendStatusResponse", []interface{}{status})
fake.sendStatusResponseMutex.Unlock()
if fake.SendStatusResponseStub != nil {
return fake.SendStatusResponseStub(status)
}
if specificReturn {
return ret.result1
}
return fake.sendStatusResponseReturns.result1
}
func (fake *ResponseSender) SendStatusResponseCallCount() int {
fake.sendStatusResponseMutex.RLock()
defer fake.sendStatusResponseMutex.RUnlock()
return len(fake.sendStatusResponseArgsForCall)
}
func (fake *ResponseSender) SendStatusResponseArgsForCall(i int) cb.Status {
fake.sendStatusResponseMutex.RLock()
defer fake.sendStatusResponseMutex.RUnlock()
return fake.sendStatusResponseArgsForCall[i].status
}
func (fake *ResponseSender) SendStatusResponseReturns(result1 error) {
fake.SendStatusResponseStub = nil
fake.sendStatusResponseReturns = struct {
result1 error
}{result1}
}
func (fake *ResponseSender) SendStatusResponseReturnsOnCall(i int, result1 error) {
fake.SendStatusResponseStub = nil
if fake.sendStatusResponseReturnsOnCall == nil {
fake.sendStatusResponseReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.sendStatusResponseReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *ResponseSender) SendBlockResponse(block *cb.Block) error {
fake.sendBlockResponseMutex.Lock()
ret, specificReturn := fake.sendBlockResponseReturnsOnCall[len(fake.sendBlockResponseArgsForCall)]
fake.sendBlockResponseArgsForCall = append(fake.sendBlockResponseArgsForCall, struct {
block *cb.Block
}{block})
fake.recordInvocation("SendBlockResponse", []interface{}{block})
fake.sendBlockResponseMutex.Unlock()
if fake.SendBlockResponseStub != nil {
return fake.SendBlockResponseStub(block)
}
if specificReturn {
return ret.result1
}
return fake.sendBlockResponseReturns.result1
}
func (fake *ResponseSender) SendBlockResponseCallCount() int {
fake.sendBlockResponseMutex.RLock()
defer fake.sendBlockResponseMutex.RUnlock()
return len(fake.sendBlockResponseArgsForCall)
}
func (fake *ResponseSender) SendBlockResponseArgsForCall(i int) *cb.Block {
fake.sendBlockResponseMutex.RLock()
defer fake.sendBlockResponseMutex.RUnlock()
return fake.sendBlockResponseArgsForCall[i].block
}
func (fake *ResponseSender) SendBlockResponseReturns(result1 error) {
fake.SendBlockResponseStub = nil
fake.sendBlockResponseReturns = struct {
result1 error
}{result1}
}
func (fake *ResponseSender) SendBlockResponseReturnsOnCall(i int, result1 error) {
fake.SendBlockResponseStub = nil
if fake.sendBlockResponseReturnsOnCall == nil {
fake.sendBlockResponseReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.sendBlockResponseReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *ResponseSender) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.sendStatusResponseMutex.RLock()
defer fake.sendStatusResponseMutex.RUnlock()
fake.sendBlockResponseMutex.RLock()
defer fake.sendBlockResponseMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *ResponseSender) 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.ResponseSender = new(ResponseSender)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mirrors/hyperledger-fabric.git
git@gitee.com:mirrors/hyperledger-fabric.git
mirrors
hyperledger-fabric
hyperledger-fabric
v1.2.0

搜索帮助