discovery

package
v0.0.0-...-fbe82ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func AddCommands

func AddCommands(cli CommandRegistrar)

addcommands将发现命令注册到给定的commandregistrar

Types

type ClientStub

type ClientStub struct {
}

ClientStub是一个与发现服务通信的存根 using the discovery client implementation

func (*ClientStub) Send

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

发送发送请求并接收响应

type CommandRegistrar

type CommandRegistrar interface {
	//命令将新的顶级命令添加到CLI
	Command(name, help string, onCommand common.CLICommand) *kingpin.CmdClause
}

命令注册寄存器命令

type ConfigCmd

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

configCmd执行检索config的命令

func NewConfigCmd

func NewConfigCmd(stub Stub, parser ResponseParser) *ConfigCmd

newconfigCmd创建新的configCmd

func (*ConfigCmd) Execute

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

执行执行命令

func (*ConfigCmd) SetChannel

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

setchannel设置configCmd的通道

func (*ConfigCmd) SetServer

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

setserver设置configCmd的服务器

type ConfigResponseParser

type ConfigResponseParser struct {
	io.Writer
}

configresponseparser分析配置响应

func (*ConfigResponseParser) ParseResponse

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

ParseResponse解析给定通道的给定响应

type EndorserResponseParser

type EndorserResponseParser struct {
	io.Writer
}

RemarkerResponseParser解析来自对等方的认可响应

func (*EndorserResponseParser) ParseResponse

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

ParseResponse解析给定通道的给定响应

type EndorsersCmd

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

背书命令执行一个命令,该命令检索链码调用链的背书人。

func NewEndorsersCmd

func NewEndorsersCmd(stub Stub, parser ResponseParser) *EndorsersCmd

新建背书命令创建新的背书命令

func (*EndorsersCmd) Execute

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

执行执行命令

func (*EndorsersCmd) SetChaincodes

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

setchaincodes将链码设置为给定的链码

func (*EndorsersCmd) SetChannel

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

setchannel设置通道

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)

设置服务器设置服务器

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使用给定的存根和响应分析器创建一个新的peerCmd

func (*PeerCmd) Execute

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

执行执行命令

func (*PeerCmd) SetChannel

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

setchannel设置peerCmd的通道

func (*PeerCmd) SetServer

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

setserver设置peerCmd的服务器

type PeerResponseParser

type PeerResponseParser struct {
	io.Writer
}

PeerResponseParser分析通道对等响应

func (*PeerResponseParser) ParseResponse

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

ParseResponse解析给定通道的给定响应

type RawStub

type RawStub struct {
}

rawstub是一个与发现服务通信的存根 没有任何中间人。

func (*RawStub) Send

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

发送发送请求并接收响应

type ResponseParser

type ResponseParser interface {
	//ParseResponse解析响应并在发出数据时使用给定的输出
	ParseResponse(channel string, response ServiceResponse) error
}

ResponseParser分析从服务器发送的响应

type ServiceResponse

type ServiceResponse interface {
	//ForChannel返回给定通道上下文中的ChannelResponse
	ForChannel(string) discovery.ChannelResponse

	//forlocal返回无通道上下文中的localresponse
	ForLocal() discovery.LocalResponse

	//RAW返回来自服务器的原始响应
	Raw() *Response
}

ServiceResponse表示从发现服务发送的响应

type Stub

type Stub interface {
	//发送发送请求并接收响应
	Send(server string, conf common.Config, req *discovery.Request) (ServiceResponse, error)
}

存根表示远程发现服务

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL