3 Star 6 Fork 7

Gitee 极速下载/Hyperledger fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hyperledger/fabric
克隆/下载
dialer.go 3.06 KB
一键复制 编辑 原始数据 按行查看 历史
Jason Yellick 提交于 2019-09-09 11:07 . FAB-7559 Reimplement blocksprovider
// Code generated by counterfeiter. DO NOT EDIT.
package fake
import (
"crypto/x509"
"sync"
"github.com/hyperledger/fabric/internal/pkg/peer/blocksprovider"
"google.golang.org/grpc"
)
type Dialer struct {
DialStub func(string, *x509.CertPool) (*grpc.ClientConn, error)
dialMutex sync.RWMutex
dialArgsForCall []struct {
arg1 string
arg2 *x509.CertPool
}
dialReturns struct {
result1 *grpc.ClientConn
result2 error
}
dialReturnsOnCall map[int]struct {
result1 *grpc.ClientConn
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *Dialer) Dial(arg1 string, arg2 *x509.CertPool) (*grpc.ClientConn, error) {
fake.dialMutex.Lock()
ret, specificReturn := fake.dialReturnsOnCall[len(fake.dialArgsForCall)]
fake.dialArgsForCall = append(fake.dialArgsForCall, struct {
arg1 string
arg2 *x509.CertPool
}{arg1, arg2})
fake.recordInvocation("Dial", []interface{}{arg1, arg2})
fake.dialMutex.Unlock()
if fake.DialStub != nil {
return fake.DialStub(arg1, arg2)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.dialReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *Dialer) DialCallCount() int {
fake.dialMutex.RLock()
defer fake.dialMutex.RUnlock()
return len(fake.dialArgsForCall)
}
func (fake *Dialer) DialCalls(stub func(string, *x509.CertPool) (*grpc.ClientConn, error)) {
fake.dialMutex.Lock()
defer fake.dialMutex.Unlock()
fake.DialStub = stub
}
func (fake *Dialer) DialArgsForCall(i int) (string, *x509.CertPool) {
fake.dialMutex.RLock()
defer fake.dialMutex.RUnlock()
argsForCall := fake.dialArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *Dialer) DialReturns(result1 *grpc.ClientConn, result2 error) {
fake.dialMutex.Lock()
defer fake.dialMutex.Unlock()
fake.DialStub = nil
fake.dialReturns = struct {
result1 *grpc.ClientConn
result2 error
}{result1, result2}
}
func (fake *Dialer) DialReturnsOnCall(i int, result1 *grpc.ClientConn, result2 error) {
fake.dialMutex.Lock()
defer fake.dialMutex.Unlock()
fake.DialStub = nil
if fake.dialReturnsOnCall == nil {
fake.dialReturnsOnCall = make(map[int]struct {
result1 *grpc.ClientConn
result2 error
})
}
fake.dialReturnsOnCall[i] = struct {
result1 *grpc.ClientConn
result2 error
}{result1, result2}
}
func (fake *Dialer) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.dialMutex.RLock()
defer fake.dialMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *Dialer) 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 _ blocksprovider.Dialer = new(Dialer)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/fabric.git
git@gitee.com:mirrors/fabric.git
mirrors
fabric
Hyperledger fabric
v2.1.1

搜索帮助

0d507c66 1850385 C8b1a773 1850385