broadcast

package
v0.0.0-...-c410d66 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClassifyError

func ClassifyError(err error) cb.Status

ClassifyError converts an error type into a status code.

Types

type ChannelSupport

type ChannelSupport interface {
	msgprocessor.Processor
	Consenter
}

ChannelSupport provides the backing resources needed to support broadcast on a channel

type ChannelSupportRegistrar

type ChannelSupportRegistrar interface {
	// BroadcastChannelSupport returns the message channel header, whether the message is a config update
	// and the channel resources for a message or an error if the message is not a message which can
	// be processed directly (like CONFIG and ORDERER_TRANSACTION messages)
	BroadcastChannelSupport(msg *cb.Envelope) (*cb.ChannelHeader, bool, ChannelSupport, error)
}

ChannelSupportRegistrar provides a way for the Handler to look up the Support for a channel

type Consenter

type Consenter interface {
	// Order accepts a message or returns an error indicating the cause of failure
	// It ultimately passes through to the consensus.Chain interface
	Order(env *cb.Envelope, configSeq uint64) error

	// Configure accepts a reconfiguration or returns an error indicating the cause of failure
	// It ultimately passes through to the consensus.Chain interface
	Configure(configUpdateMsg *cb.Envelope, config *cb.Envelope, configSeq uint64) error
}

Consenter provides methods to send messages through consensus

type Handler

type Handler interface {
	// Handle starts a service thread for a given gRPC connection and services the broadcast connection
	Handle(srv ab.AtomicBroadcast_BroadcastServer) error
}

Handler defines an interface which handles broadcasts

func NewHandlerImpl

func NewHandlerImpl(sm ChannelSupportRegistrar) Handler

NewHandlerImpl constructs a new implementation of the Handler interface

Jump to

Keyboard shortcuts

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