deliver

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeliverServer

type DeliverServer struct {
	DeliverSupport
	PolicyChecker
	Send func(msg proto.Message) error
}

DeliverServer a polymorphic structure to support generalization of this handler to be able to deliver different type of responses

func NewDeliverServer

func NewDeliverServer(support DeliverSupport, policyChecker PolicyChecker, send func(msg proto.Message) error) *DeliverServer

NewDeliverServer constructing deliver

type DeliverSupport

type DeliverSupport interface {
	Recv() (*cb.Envelope, error)
	Context() context.Context
	CreateStatusReply(status cb.Status) proto.Message
	CreateBlockReply(block *cb.Block) proto.Message
}

DeliverSupport defines the interface a handler must implement for delivery services

type Handler

type Handler interface {
	Handle(srv *DeliverServer) error
}

Handler defines an interface which handles Deliver requests

func NewHandlerImpl

func NewHandlerImpl(sm SupportManager, timeWindow time.Duration, mutualTLS bool) Handler

NewHandlerImpl creates an implementation of the Handler interface

type PolicyChecker

type PolicyChecker func(envelope *cb.Envelope, channelID string) error

PolicyChecker checks the envelope against the policy logic supplied by the function

type Support

type Support interface {
	// Sequence returns the current config sequence number, can be used to detect config changes
	Sequence() uint64

	// PolicyManager returns the current policy manager as specified by the chain configuration
	PolicyManager() policies.Manager

	// Reader returns the chain Reader for the chain
	Reader() blockledger.Reader

	// Errored returns a channel which closes when the backing consenter has errored
	Errored() <-chan struct{}
}

Support provides the backing resources needed to support deliver on a chain

type SupportManager

type SupportManager interface {
	GetChain(chainID string) (Support, bool)
}

SupportManager provides a way for the Handler to look up the Support for a chain

Jump to

Keyboard shortcuts

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