msgprocessor

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcceptRule = Rule(acceptRule{})
View Source
var EmptyRejectRule = Rule(emptyRejectRule{})
View Source
var ErrChannelDoesNotExist = errors.New("channel does not exist")
View Source
var ErrEmptyMessage = errors.New("Message was empty")
View Source
var ErrMaintenanceMode = errors.New("maintenance mode")
View Source
var ErrPermissionDenied = errors.New("permission denied")

Functions

This section is empty.

Types

type ChainCreator

type ChainCreator interface {
	NewChannelConfig(envConfigUpdate *cb.Envelope) (channelconfig.Resources, error)

	CreateBundle(channelID string, config *cb.Config) (channelconfig.Resources, error)

	ChannelsCount() int
}

type ChannelConfigTemplator

type ChannelConfigTemplator interface {
	NewChannelConfig(env *cb.Envelope) (channelconfig.Resources, error)
}

type Classification

type Classification int
const (
	NormalMsg Classification = iota

	ConfigUpdateMsg

	ConfigMsg
)

type DefaultTemplator

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

func NewDefaultTemplator

func NewDefaultTemplator(support DefaultTemplatorSupport) *DefaultTemplator

func (*DefaultTemplator) NewChannelConfig

func (dt *DefaultTemplator) NewChannelConfig(envConfigUpdate *cb.Envelope) (channelconfig.Resources, error)

type DefaultTemplatorSupport

type DefaultTemplatorSupport interface {
	ConsortiumsConfig() (channelconfig.Consortiums, bool)

	OrdererConfig() (channelconfig.Orderer, bool)

	ConfigtxValidator() configtx.Validator

	Signer() identity.SignerSerializer
}

type LimitedSupport

type LimitedSupport interface {
	OrdererConfig() (channelconfig.Orderer, bool)
}

type MaintenanceFilter

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

func NewMaintenanceFilter

func NewMaintenanceFilter(support MaintenanceFilterSupport) *MaintenanceFilter

func (*MaintenanceFilter) Apply

func (mf *MaintenanceFilter) Apply(message *cb.Envelope) error

type MaintenanceFilterSupport

type MaintenanceFilterSupport interface {
	OrdererConfig() (channelconfig.Orderer, bool)

	ChannelID() string
}

type MaxBytesRule

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

func NewSizeFilter

func NewSizeFilter(resources SizeFilterResources) *MaxBytesRule

func (*MaxBytesRule) Apply

func (r *MaxBytesRule) Apply(message *common.Envelope) error

type MetadataValidator

type MetadataValidator interface {
	ValidateConsensusMetadata(oldMetadata, newMetadata []byte, newChannel bool) error
}

type Processor

type Processor interface {
	ClassifyMsg(chdr *cb.ChannelHeader) Classification

	ProcessNormalMsg(env *cb.Envelope) (configSeq uint64, err error)

	ProcessConfigUpdateMsg(env *cb.Envelope) (config *cb.Envelope, configSeq uint64, err error)

	ProcessConfigMsg(env *cb.Envelope) (*cb.Envelope, uint64, error)
}

type Rule

type Rule interface {
	Apply(message *ab.Envelope) error
}

func NewExpirationRejectRule

func NewExpirationRejectRule(filterSupport resources) Rule

type RuleSet

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

func CreateStandardChannelFilters

func CreateStandardChannelFilters(filterSupport channelconfig.Resources, config localconfig.TopLevel) *RuleSet

func CreateSystemChannelFilters

func CreateSystemChannelFilters(
	config localconfig.TopLevel,
	chainCreator ChainCreator,
	ledgerResources channelconfig.Resources,
	validator MetadataValidator,
) *RuleSet

func NewRuleSet

func NewRuleSet(rules []Rule) *RuleSet

func (*RuleSet) Apply

func (rs *RuleSet) Apply(message *ab.Envelope) error

type SigFilter

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

func NewSigFilter

func NewSigFilter(normalPolicyName, maintenancePolicyName string, support SigFilterSupport) *SigFilter

func (*SigFilter) Apply

func (sf *SigFilter) Apply(message *cb.Envelope) error

type SigFilterSupport

type SigFilterSupport interface {
	PolicyManager() policies.Manager

	OrdererConfig() (channelconfig.Orderer, bool)
}

type SizeFilterResources

type SizeFilterResources interface {
	OrdererConfig() (channelconfig.Orderer, bool)
}

type StandardChannel

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

func NewStandardChannel

func NewStandardChannel(support StandardChannelSupport, filters *RuleSet) *StandardChannel

func (*StandardChannel) ClassifyMsg

func (s *StandardChannel) ClassifyMsg(chdr *cb.ChannelHeader) Classification

func (*StandardChannel) ProcessConfigMsg

func (s *StandardChannel) ProcessConfigMsg(env *cb.Envelope) (config *cb.Envelope, configSeq uint64, err error)

func (*StandardChannel) ProcessConfigUpdateMsg

func (s *StandardChannel) ProcessConfigUpdateMsg(env *cb.Envelope) (config *cb.Envelope, configSeq uint64, err error)

func (*StandardChannel) ProcessNormalMsg

func (s *StandardChannel) ProcessNormalMsg(env *cb.Envelope) (configSeq uint64, err error)

type StandardChannelSupport

type StandardChannelSupport interface {
	Sequence() uint64

	ChannelID() string

	Signer() identity.SignerSerializer

	ProposeConfigUpdate(configtx *cb.Envelope) (*cb.ConfigEnvelope, error)

	OrdererConfig() (channelconfig.Orderer, bool)
}

type SystemChainFilter

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

func NewSystemChannelFilter

func NewSystemChannelFilter(ls LimitedSupport, cc ChainCreator, validator MetadataValidator) *SystemChainFilter

func (*SystemChainFilter) Apply

func (scf *SystemChainFilter) Apply(env *cb.Envelope) error

type SystemChannel

type SystemChannel struct {
	*StandardChannel
	// contains filtered or unexported fields
}

func NewSystemChannel

func NewSystemChannel(support StandardChannelSupport, templator ChannelConfigTemplator, filters *RuleSet) *SystemChannel

func (*SystemChannel) ProcessConfigMsg

func (s *SystemChannel) ProcessConfigMsg(env *cb.Envelope) (*cb.Envelope, uint64, error)

func (*SystemChannel) ProcessConfigUpdateMsg

func (s *SystemChannel) ProcessConfigUpdateMsg(envConfigUpdate *cb.Envelope) (config *cb.Envelope, configSeq uint64, err error)

func (*SystemChannel) ProcessNormalMsg

func (s *SystemChannel) ProcessNormalMsg(msg *cb.Envelope) (configSeq uint64, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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