peer

package
v0.0.0-...-523a819 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCCComm

type MockCCComm struct {
	// contains filtered or unexported fields
}

mockcccomm实现了链码和对等端之间的模拟通信。

func (*MockCCComm) CloseSend

func (s *MockCCComm) CloseSend() error

func (*MockCCComm) GetRecvStream

func (s *MockCCComm) GetRecvStream() chan *pb.ChaincodeMessage

func (*MockCCComm) GetSendStream

func (s *MockCCComm) GetSendStream() chan *pb.ChaincodeMessage

func (*MockCCComm) Quit

func (s *MockCCComm) Quit()

func (*MockCCComm) Recv

func (s *MockCCComm) Recv() (*pb.ChaincodeMessage, error)

func (*MockCCComm) Run

func (s *MockCCComm) Run(done <-chan struct{}) error

func (*MockCCComm) Send

func (s *MockCCComm) Send(msg *pb.ChaincodeMessage) error

func (*MockCCComm) SetBailOnError

func (s *MockCCComm) SetBailOnError(b bool)

func (*MockCCComm) SetKeepAlive

func (s *MockCCComm) SetKeepAlive(ka *pb.ChaincodeMessage)

setkeepalive设置keepalive。此mut只能在服务器上完成

func (*MockCCComm) SetName

func (s *MockCCComm) SetName(newname string)

func (*MockCCComm) SetPong

func (s *MockCCComm) SetPong(val bool)

func (*MockCCComm) SetResponses

func (s *MockCCComm) SetResponses(respSet *MockResponseSet)

type MockPeerCCSupport

type MockPeerCCSupport struct {
	// contains filtered or unexported fields
}

func NewMockPeerSupport

func NewMockPeerSupport() *MockPeerCCSupport

func (*MockPeerCCSupport) AddCC

func (mp *MockPeerCCSupport) AddCC(name string, recv chan *pb.ChaincodeMessage, send chan *pb.ChaincodeMessage) (*MockCCComm, error)

addcc将cc添加到mockpeerccsupport

func (*MockPeerCCSupport) GetCC

func (mp *MockPeerCCSupport) GetCC(name string) (*MockCCComm, error)

func (*MockPeerCCSupport) GetCCMirror

func (mp *MockPeerCCSupport) GetCCMirror(name string) *MockCCComm

func (*MockPeerCCSupport) RemoveAll

func (mp *MockPeerCCSupport) RemoveAll() error

func (*MockPeerCCSupport) RemoveCC

func (mp *MockPeerCCSupport) RemoveCC(name string) error

type MockResponse

type MockResponse struct {
	RecvMsg *pb.ChaincodeMessage
	RespMsg interface{}
}

和发送响应(可选)

type MockResponseSet

type MockResponseSet struct {
	//
	//响应集
	DoneFunc func(int, error)

	//当输入没有被调用时,任何步骤都会调用errorfunc。
	//匹配收到的消息
	ErrorFunc func(int, error)

	//
	//和发送响应(可选)
	Responses []*MockResponse
}

mockresponseset用于处理CC到对等通信 例如get/put/del state。mockResponse包含

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL