Documentation ¶
Index ¶
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 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 *discovery.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) SetServer ¶
func (pc *EndorsersCmd) SetServer(server *string)
SetServer sets the server
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.
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) discovery.ChannelResponse // ForLocal returns a LocalResponse in the context of no channel ForLocal() discovery.LocalResponse // Raw returns the raw response from the server Raw() *Response }
ServiceResponse represents a response sent from the discovery service