Documentation
¶
Index ¶
- type ChannelAdapter
- type ChannelClient
- func (cc *ChannelClient) CreateEnvelopeForChannelServiceRequest(csreq *serverapi.ChannelServiceRequest) (*common.Envelope, error)
- func (cc *ChannelClient) DeregisterAsync(channels []string) error
- func (cc *ChannelClient) Recv() (*serverapi.ChannelServiceResponse, error)
- func (cc *ChannelClient) RegisterAsync(config *RegistrationConfig) error
- func (cc *ChannelClient) Send(csreq *serverapi.ChannelServiceRequest) error
- func (cc *ChannelClient) SendEnvelope(env *common.Envelope) error
- func (cc *ChannelClient) Start() error
- func (cc *ChannelClient) Stop() error
- type RegistrationConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelAdapter ¶
type ChannelAdapter interface {
GetInterestedChannels() ([]string, error)
GetInterestedEvents() ([]*peer.Interest, error)
Recv(msg *api.ChannelServiceResponse) (bool, error)
Disconnected(err error)
}
ChannelAdapter is the interface by which a fabric channel service client registers for interested channels and receives events from the channel service server. This is a reference Go implementation of a channel service client
type ChannelClient ¶
ChannelClient holds the stream and adapter for client to work with
func NewChannelClient ¶
func NewChannelClient(peerAddress string, regTimeout time.Duration, adapter ChannelAdapter) (*ChannelClient, error)
NewChannelClient returns a new grpc.ClientConn to the configured local peer
func (*ChannelClient) CreateEnvelopeForChannelServiceRequest ¶
func (cc *ChannelClient) CreateEnvelopeForChannelServiceRequest(csreq *serverapi.ChannelServiceRequest) (*common.Envelope, error)
CreateEnvelopeForChannelServiceRequest creates a signed envelope for a given ChannelServiceRequest
func (*ChannelClient) DeregisterAsync ¶
func (cc *ChannelClient) DeregisterAsync(channels []string) error
DeregisterAsync deregisters interest in channel and doesn't wait for a response
func (*ChannelClient) Recv ¶
func (cc *ChannelClient) Recv() (*serverapi.ChannelServiceResponse, error)
Recv receives next event - use when client has not called Start
func (*ChannelClient) RegisterAsync ¶
func (cc *ChannelClient) RegisterAsync(config *RegistrationConfig) error
RegisterAsync registers interest based on the provided RegistrationConfig and doesn't wait for a response
func (*ChannelClient) Send ¶
func (cc *ChannelClient) Send(csreq *serverapi.ChannelServiceRequest) error
Send takes a ChannelServiceRequest, creates a signed envelope, and sends it to the connected ChannelServer
func (*ChannelClient) SendEnvelope ¶
func (cc *ChannelClient) SendEnvelope(env *common.Envelope) error
SendEnvelope sends a signed envelope to the connected ChannelServer
func (*ChannelClient) Start ¶
func (cc *ChannelClient) Start() error
Start establishes connection with channel service server and registers for interested channels
func (*ChannelClient) Stop ¶
func (cc *ChannelClient) Stop() error
Stop terminates connection with the channel service server