{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package discovery\n\n## Constants\n\n```go\nconst (\n\tPeersCommand     = \"peers\"\n\tConfigCommand    = \"config\"\n\tEndorsersCommand = \"endorsers\"\n)\n```\n\n## Functions\n\n```go\nfunc AddCommands(cli CommandRegistrar)\n```\nAddCommands registers the discovery commands to the given CommandRegistrar\n\n## Types\n\n```go\ntype ClientStub struct {\n}\n```\nClientStub is a stub that communicates with the discovery service using the discovery client implementation\n\n```go\nfunc (stub *ClientStub) Send(server string, conf common.Config, req *discovery.Request) (ServiceResponse, error)\n```\nSend sends the request, and receives a response\n\n```go\ntype CommandRegistrar interface {\n\t// Command adds a new top-level command to the CLI\n\tCommand(name, help string, onCommand common.CLICommand) *kingpin.CmdClause\n}\n```\nCommandRegistrar registers commands\n\n```go\ntype ConfigCmd struct {\n\t// contains filtered or unexported fields\n}\n```\nConfigCmd executes a command that retrieves config\n\n```go\nfunc NewConfigCmd(stub Stub, parser ResponseParser) *ConfigCmd\n```\nNewConfigCmd creates a new ConfigCmd\n\n```go\nfunc (pc *ConfigCmd) Execute(conf common.Config) error\n```\nExecute executes the command\n\n```go\nfunc (pc *ConfigCmd) SetChannel(channel *string)\n```\nSetChannel sets the channel of the ConfigCmd\n\n```go\nfunc (pc *ConfigCmd) SetServer(server *string)\n```\nSetServer sets the server of the ConfigCmd\n\n```go\ntype ConfigResponseParser struct {\n\tio.Writer\n}\n```\nConfigResponseParser parses config responses\n\n```go\nfunc (parser *ConfigResponseParser) ParseResponse(channel string, res ServiceResponse) error\n```\nParseResponse parses the given response for the given channel\n\n```go\ntype EndorserResponseParser struct {\n\tio.Writer\n}\n```\nEndorserResponseParser parses endorsement responses from the peer\n\n```go\nfunc (parser *EndorserResponseParser) ParseResponse(channel string, res ServiceResponse) error\n```\nParseResponse parses the given response for the given channel\n\n```go\ntype EndorsersCmd struct {\n\t// contains filtered or unexported fields\n}\n```\nEndorsersCmd executes a command that retrieves endorsers for a chaincode invocation chain\n\n```go\nfunc NewEndorsersCmd(stub Stub, parser ResponseParser) *EndorsersCmd\n```\nNewEndorsersCmd creates a new EndorsersCmd\n\n```go\nfunc (pc *EndorsersCmd) Execute(conf common.Config) error\n```\nExecute executes the command\n\n```go\nfunc (pc *EndorsersCmd) SetChaincodes(chaincodes *[]string)\n```\nSetChaincodes sets the chaincodes to be the given chaincodes\n\n```go\nfunc (pc *EndorsersCmd) SetChannel(channel *string)\n```\nSetChannel sets the channel\n\n```go\nfunc (pc *EndorsersCmd) SetCollections(collections *map[string]string)\n```\nSetCollections sets the collections to be the given collections\n\n```go\nfunc (pc *EndorsersCmd) SetServer(server *string)\n```\nSetServer sets the server\n\n```go\ntype PeerCmd struct {\n\t// contains filtered or unexported fields\n}\n```\nPeerCmd executes channelPeer listing command\n\n```go\nfunc NewPeerCmd(stub Stub, parser ResponseParser) *PeerCmd\n```\nNewPeerCmd creates a new PeerCmd with the given Stub and ResponseParser\n\n```go\nfunc (pc *PeerCmd) Execute(conf common.Config) error\n```\nExecute executes the command\n\n```go\nfunc (pc *PeerCmd) SetChannel(channel *string)\n```\nSetChannel sets the channel of the PeerCmd\n\n```go\nfunc (pc *PeerCmd) SetServer(server *string)\n```\nSetServer sets the server of the PeerCmd\n\n```go\ntype PeerResponseParser struct {\n\tio.Writer\n}\n```\nPeerResponseParser parses a channelPeer response\n\n```go\nfunc (parser *PeerResponseParser) ParseResponse(channel string, res ServiceResponse) error\n```\nParseResponse parses the given response about the given channel\n\n```go\ntype RawStub struct {\n}\n```\nRawStub is a stub that communicates with the discovery service without any intermediary.\n\n```go\nfunc (stub *RawStub) Send(server string, conf common.Config, req *discovery.Request) (ServiceResponse, error)\n```\nSend sends the request, and receives a response\n\n```go\ntype ResponseParser interface {\n\t// ParseResponse parses the response and uses the given output when emitting data\n\tParseResponse(channel string, response ServiceResponse) error\n}\n```\nResponseParser parses responses sent from the server\n\n```go\ntype ServiceResponse interface {\n\t// ForChannel returns a ChannelResponse in the context of a given channel\n\tForChannel(string) discovery.ChannelResponse\n\n\t// ForLocal returns a LocalResponse in the context of no channel\n\tForLocal() discovery.LocalResponse\n\n\t// Raw returns the raw response from the server\n\tRaw() *Response\n}\n```\nServiceResponse represents a response sent from the discovery service\n\n```go\ntype Stub interface {\n\t// Send sends the request, and receives a response\n\tSend(server string, conf common.Config, req *discovery.Request) (ServiceResponse, error)\n}\n```\nStub represents the remote discovery service\n\n","path":"github.com/eric-erki/https-hyperledger.org/discovery/cmd","name":"discovery","synopsis":"","isRedistributable":true}
