fabric: github.com/hyperledger/fabric/discovery/cmd Index | Files | Directories

package discovery

import "github.com/hyperledger/fabric/discovery/cmd"

Index

Package Files

cmd.go config.go endorsers.go peers.go stub.go

Constants

const (
    PeersCommand     = "peers"
    ConfigCommand    = "config"
    EndorsersCommand = "endorsers"
)

func AddCommands Uses

func AddCommands(cli CommandRegistrar)

AddCommands registers the discovery commands to the given CommandRegistrar

type ClientStub Uses

type ClientStub struct {
}

ClientStub is a stub that communicates with the discovery service using the discovery client implementation

func (*ClientStub) Send Uses

func (stub *ClientStub) Send(server string, conf common.Config, req *discovery.Request) (ServiceResponse, error)

Send sends the request, and receives a response

type CommandRegistrar Uses

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 Uses

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

ConfigCmd executes a command that retrieves config

func NewConfigCmd Uses

func NewConfigCmd(stub Stub, parser ResponseParser) *ConfigCmd

NewConfigCmd creates a new ConfigCmd

func (*ConfigCmd) Execute Uses

func (pc *ConfigCmd) Execute(conf common.Config) error

Execute executes the command

func (*ConfigCmd) SetChannel Uses

func (pc *ConfigCmd) SetChannel(channel *string)

SetChannel sets the channel of the ConfigCmd

func (*ConfigCmd) SetServer Uses

func (pc *ConfigCmd) SetServer(server *string)

SetServer sets the server of the ConfigCmd

type ConfigResponseParser Uses

type ConfigResponseParser struct {
    io.Writer
}

ConfigResponseParser parses config responses

func (*ConfigResponseParser) ParseResponse Uses

func (parser *ConfigResponseParser) ParseResponse(channel string, res ServiceResponse) error

ParseResponse parses the given response for the given channel

type EndorserResponseParser Uses

type EndorserResponseParser struct {
    io.Writer
}

EndorserResponseParser parses endorsement responses from the peer

func (*EndorserResponseParser) ParseResponse Uses

func (parser *EndorserResponseParser) ParseResponse(channel string, res ServiceResponse) error

ParseResponse parses the given response for the given channel

type EndorsersCmd Uses

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

EndorsersCmd executes a command that retrieves endorsers for a chaincode invocation chain

func NewEndorsersCmd Uses

func NewEndorsersCmd(stub Stub, parser ResponseParser) *EndorsersCmd

NewEndorsersCmd creates a new EndorsersCmd

func (*EndorsersCmd) Execute Uses

func (pc *EndorsersCmd) Execute(conf common.Config) error

Execute executes the command

func (*EndorsersCmd) SetChaincodes Uses

func (pc *EndorsersCmd) SetChaincodes(chaincodes *[]string)

SetChaincodes sets the chaincodes to be the given chaincodes

func (*EndorsersCmd) SetChannel Uses

func (pc *EndorsersCmd) SetChannel(channel *string)

SetChannel sets the channel

func (*EndorsersCmd) SetCollections Uses

func (pc *EndorsersCmd) SetCollections(collections *map[string]string)

SetCollections sets the collections to be the given collections

func (*EndorsersCmd) SetServer Uses

func (pc *EndorsersCmd) SetServer(server *string)

SetServer sets the server

type PeerCmd Uses

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

PeerCmd executes channelPeer listing command

func NewPeerCmd Uses

func NewPeerCmd(stub Stub, parser ResponseParser) *PeerCmd

NewPeerCmd creates a new PeerCmd with the given Stub and ResponseParser

func (*PeerCmd) Execute Uses

func (pc *PeerCmd) Execute(conf common.Config) error

Execute executes the command

func (*PeerCmd) SetChannel Uses

func (pc *PeerCmd) SetChannel(channel *string)

SetChannel sets the channel of the PeerCmd

func (*PeerCmd) SetServer Uses

func (pc *PeerCmd) SetServer(server *string)

SetServer sets the server of the PeerCmd

type PeerResponseParser Uses

type PeerResponseParser struct {
    io.Writer
}

PeerResponseParser parses a channelPeer response

func (*PeerResponseParser) ParseResponse Uses

func (parser *PeerResponseParser) ParseResponse(channel string, res ServiceResponse) error

ParseResponse parses the given response about the given channel

type RawStub Uses

type RawStub struct {
}

RawStub is a stub that communicates with the discovery service without any intermediary.

func (*RawStub) Send Uses

func (stub *RawStub) Send(server string, conf common.Config, req *discovery.Request) (ServiceResponse, error)

Send sends the request, and receives a response

type ResponseParser Uses

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 Uses

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

type Stub Uses

type Stub interface {
    // Send sends the request, and receives a response
    Send(server string, conf common.Config, req *discovery.Request) (ServiceResponse, error)
}

Stub represents the remote discovery service

Directories

PathSynopsis
mocksCode generated by mockery v1.0.0.

Package discovery imports 19 packages (graph) and is imported by 2 packages. Updated 2018-10-12. Refresh now. Tools for package owners.