Back to godoc.org
github.com/hyperledger/fabric-sdk-go / pkg / fab / discovery / mocks

package mocks

v1.0.0 (01fc6e2)
Latest Go to latest
Published: Jul 6, 2020 | License: Apache-2.0 | Module: github.com/hyperledger/fabric-sdk-go

Index

Package Files

type MockDiscoveryPeerEndpoint

type MockDiscoveryPeerEndpoint struct {
	MSPID        string
	Endpoint     string
	LedgerHeight uint64
}

MockDiscoveryPeerEndpoint contains information about a Discover peer endpoint

type MockDiscoveryServer

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

MockDiscoveryServer is a mock Discovery server

func NewServer

func NewServer(opts ...MockDiscoveryServerOpt) *MockDiscoveryServer

NewServer returns a new MockDiscoveryServer

func (*MockDiscoveryServer) Discover

func (s *MockDiscoveryServer) Discover(ctx context.Context, request *discovery.SignedRequest) (*discovery.Response, error)

Discover Processes the given Discovery request and returns a mock response

type MockDiscoveryServerOpt

type MockDiscoveryServerOpt func(s *MockDiscoveryServer)

MockDiscoveryServerOpt is an option for the MockDiscoveryServer

func WithLocalPeers

func WithLocalPeers(peers ...*MockDiscoveryPeerEndpoint) MockDiscoveryServerOpt

WithLocalPeers adds a set of mock peers to the MockDiscoveryServer

func WithPeers

func WithPeers(peers ...*MockDiscoveryPeerEndpoint) MockDiscoveryServerOpt

WithPeers adds a set of mock peers to the MockDiscoveryServer

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier