Documentation ¶
Index ¶
- Constants
- func AddCommands(cli CommandRegistrar)
- type ChannelResponse
- type ClientStub
- type CommandRegistrar
- type ConfigCmd
- type ConfigResponseParser
- type EndorserResponseParser
- type EndorsersCmd
- func (pc *EndorsersCmd) Execute(conf common.Config) error
- func (pc *EndorsersCmd) SetChaincodes(chaincodes *[]string)
- func (pc *EndorsersCmd) SetChannel(channel *string)
- func (pc *EndorsersCmd) SetCollections(collections *map[string]string)
- func (pc *EndorsersCmd) SetNoPrivateReads(noPrivReads *[]string)
- func (pc *EndorsersCmd) SetServer(server *string)
- type LocalResponse
- type PeerCmd
- type PeerResponseParser
- type RawStub
- type ResponseParser
- type ServiceResponse
- type Stub
Constants ¶
const ( PeersCommand = "peers" ConfigCommand = "config" EndorsersCommand = "endorsers" )
Variables ¶
This section is empty.
Functions ¶
func AddCommands ¶
func AddCommands(cli CommandRegistrar)
AddCommands registers the discovery commands to the given CommandRegistrar
Types ¶
type ChannelResponse ¶
type ChannelResponse interface { discoveryclient.ChannelResponse }
ChannelResponse is the local interface used to generate mocks for foreign interface.
type ClientStub ¶
type ClientStub struct { }
ClientStub is a stub that communicates with the discovery service using the discovery client implementation
func (*ClientStub) Send ¶
func (stub *ClientStub) Send(server string, conf common.Config, req *discoveryclient.Request) (ServiceResponse, error)
Send sends the request, and receives a response
type CommandRegistrar ¶
type CommandRegistrar interface { // Command adds a new top-level command to the CLI Command(name, help string, onCommand common.CLICommand) *kingpin.CmdClause }
CommandRegistrar registers commands
type ConfigCmd ¶
type ConfigCmd struct {
// contains filtered or unexported fields
}
ConfigCmd executes a command that retrieves config
func NewConfigCmd ¶
func NewConfigCmd(stub Stub, parser ResponseParser) *ConfigCmd
NewConfigCmd creates a new ConfigCmd
func (*ConfigCmd) SetChannel ¶
SetChannel sets the channel of the ConfigCmd
type ConfigResponseParser ¶
ConfigResponseParser parses config responses
func (*ConfigResponseParser) ParseResponse ¶
func (parser *ConfigResponseParser) ParseResponse(channel string, res ServiceResponse) error
ParseResponse parses the given response for the given channel
type EndorserResponseParser ¶
EndorserResponseParser parses endorsement responses from the peer
func (*EndorserResponseParser) ParseResponse ¶
func (parser *EndorserResponseParser) ParseResponse(channel string, res ServiceResponse) error
ParseResponse parses the given response for the given channel
type EndorsersCmd ¶
type EndorsersCmd struct {
// contains filtered or unexported fields
}
EndorsersCmd executes a command that retrieves endorsers for a chaincode invocation chain
func NewEndorsersCmd ¶
func NewEndorsersCmd(stub Stub, parser ResponseParser) *EndorsersCmd
NewEndorsersCmd creates a new EndorsersCmd
func (*EndorsersCmd) Execute ¶
func (pc *EndorsersCmd) Execute(conf common.Config) error
Execute executes the command
func (*EndorsersCmd) SetChaincodes ¶
func (pc *EndorsersCmd) SetChaincodes(chaincodes *[]string)
SetChaincodes sets the chaincodes to be the given chaincodes
func (*EndorsersCmd) SetChannel ¶
func (pc *EndorsersCmd) SetChannel(channel *string)
SetChannel sets the channel
func (*EndorsersCmd) SetCollections ¶
func (pc *EndorsersCmd) SetCollections(collections *map[string]string)
SetCollections sets the collections to be the given collections
func (*EndorsersCmd) SetNoPrivateReads ¶
func (pc *EndorsersCmd) SetNoPrivateReads(noPrivReads *[]string)
SetNoPrivateReads sets the collections that are expected not to have private reads
func (*EndorsersCmd) SetServer ¶
func (pc *EndorsersCmd) SetServer(server *string)
SetServer sets the server
type LocalResponse ¶
type LocalResponse interface { discoveryclient.LocalResponse }
LocalResponse is the local interface used to generate mocks for foreign interface.
type PeerCmd ¶
type PeerCmd struct {
// contains filtered or unexported fields
}
PeerCmd executes channelPeer listing command
func NewPeerCmd ¶
func NewPeerCmd(stub Stub, parser ResponseParser) *PeerCmd
NewPeerCmd creates a new PeerCmd with the given Stub and ResponseParser
func (*PeerCmd) SetChannel ¶
SetChannel sets the channel of the PeerCmd
type PeerResponseParser ¶
PeerResponseParser parses a channelPeer response
func (*PeerResponseParser) ParseResponse ¶
func (parser *PeerResponseParser) ParseResponse(channel string, res ServiceResponse) error
ParseResponse parses the given response about the given channel
type RawStub ¶
type RawStub struct { }
RawStub is a stub that communicates with the discovery service without any intermediary.
func (*RawStub) Send ¶
func (stub *RawStub) Send(server string, conf common.Config, req *discoveryclient.Request) (ServiceResponse, error)
Send sends the request, and receives a response
type ResponseParser ¶
type ResponseParser interface { // ParseResponse parses the response and uses the given output when emitting data ParseResponse(channel string, response ServiceResponse) error }
ResponseParser parses responses sent from the server
type ServiceResponse ¶
type ServiceResponse interface { // ForChannel returns a ChannelResponse in the context of a given channel ForChannel(string) discoveryclient.ChannelResponse // ForLocal returns a LocalResponse in the context of no channel ForLocal() discoveryclient.LocalResponse // Raw returns the raw response from the server Raw() *discovery.Response }
ServiceResponse represents a response sent from the discovery service