plugindispatcher

package
v0.0.0-...-ff7f851 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(chainID string, cr ChannelResources, ler LedgerResources, lcr LifecycleResources, pluginValidator *PluginValidator) *dispatcherImpl

New creates new plugin dispatcher

Types

type Capabilities

type Capabilities interface {
	vc.Capabilities
}

Capabilities is the local interface that used to generate mocks for foreign interface.

type ChannelPolicyManagerGetter

type ChannelPolicyManagerGetter interface {
	policies.ChannelPolicyManagerGetter
}

ChannelPolicyManagerGetter is the local interface that used to generate mocks for foreign interface.

type ChannelResources

type ChannelResources interface {
	// GetMSPIDs returns the IDs for the application MSPs
	// that have been defined in the channel
	GetMSPIDs() []string
}

ChannelResources provides access to channel artefacts or functions to interact with them

type CollectionAndLifecycleResources

type CollectionAndLifecycleResources interface {
	LifecycleResources

	// CollectionValidationInfo is exactly like the method defined in CollectionResources but
	// also takes the channel ID.  This is necessary to determine if the org collection names are valid.
	CollectionValidationInfo(channelID, chaincodeName, collectionName string, state s.State) (args []byte, unexpectedErr error, validationErr error)
}

CollectionAndLifecycleResources provides access to resources about chaincodes and their lifecycle and collections and their policies

type CollectionResources

type CollectionResources interface {
	// CollectionValidationInfo returns collection-level endorsement policy for the supplied chaincode.
	// The function returns two types of errors, unexpected errors and validation errors. The
	// reason for this is that this function is to be called from the validation code, which
	// needs to tell apart the two types of error to halt processing on the channel if the
	// unexpected error is not nil and mark the transaction as invalid if the validation error
	// is not nil.
	CollectionValidationInfo(chaincodeName, collectionName string, state s.State) (args []byte, unexpectedErr error, validationErr error)
}

CollectionResources provides access to collection artefacts

type Context

type Context struct {
	Seq        int
	Envelope   []byte
	TxID       string
	Channel    string
	PluginName string
	Policy     []byte
	Namespace  string
	Block      *common.Block
}

Context defines information about a transaction that is being validated.

func (Context) String

func (c Context) String() string

String returns a string representation of this Context.

type IdentityDeserializer

type IdentityDeserializer interface {
	msp.IdentityDeserializer
}

IdentityDeserializer is the local interface that used to generate mocks for foreign interface.

type LedgerResources

type LedgerResources interface {
	// NewQueryExecutor gives handle to a query executor.
	// A client can obtain more than one 'QueryExecutor's for parallel execution.
	// Any synchronization should be performed at the implementation level if required
	NewQueryExecutor() (ledger.QueryExecutor, error)
}

LedgerResources provides access to ledger artefacts or functions to interact with them

type LifecycleResources

type LifecycleResources interface {
	// ValidationInfo returns the name and arguments of the validation plugin for the supplied
	// chaincode. The function returns two types of errors, unexpected errors and validation
	// errors. The reason for this is that this function is called from the validation code,
	// which needs to differentiate the two types of error to halt processing on the channel
	// if the unexpected error is not nil and mark the transaction as invalid if the validation
	// error is not nil.
	ValidationInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (plugin string, args []byte, unexpectedErr error, validationErr error)
}

LifecycleResources provides access to chaincode lifecycle artefacts or functions to interact with them

type Mapper

type Mapper interface {
	txvalidatorplugin.Mapper
}

Mapper is the local interface that used to generate mocks for foreign interface.

type Plugin

type Plugin interface {
	validation.Plugin
}

Plugin is the local interface that used to generate mocks for foreign interface.

type PluginFactory

type PluginFactory interface {
	validation.PluginFactory
}

PluginFactory is the local interface that used to generate mocks for foreign interface.

type PluginValidator

PluginValidator values transactions with validation plugins.

func NewPluginValidator

NewPluginValidator creates a new PluginValidator.

func (*PluginValidator) ValidateWithPlugin

func (pv *PluginValidator) ValidateWithPlugin(ctx *Context) error

type PolicyEvaluatorWrapper

type PolicyEvaluatorWrapper struct {
	msp.IdentityDeserializer
	vp.PolicyEvaluator
}

func (*PolicyEvaluatorWrapper) DeserializeIdentity

func (id *PolicyEvaluatorWrapper) DeserializeIdentity(serializedIdentity []byte) (vi.Identity, error)

DeserializeIdentity unmarshals the given identity to msp.Identity

func (*PolicyEvaluatorWrapper) Evaluate

func (id *PolicyEvaluatorWrapper) Evaluate(policyBytes []byte, signatureSet []*protoutil.SignedData) error

Evaluate takes a set of SignedData and evaluates whether this set of signatures satisfies the policy

type PolicyManager

type PolicyManager interface {
	policies.Manager
}

type QueryExecutorCreator

type QueryExecutorCreator interface {
	NewQueryExecutor() (ledger.QueryExecutor, error)
}

QueryExecutorCreator creates new query executors.

type ResultsIteratorImpl

type ResultsIteratorImpl struct {
	ledger2.ResultsIterator
}

func (*ResultsIteratorImpl) Next

func (it *ResultsIteratorImpl) Next() (vs.QueryResult, error)

type StateFetcherImpl

type StateFetcherImpl struct {
	QueryExecutorCreator
}

func (*StateFetcherImpl) FetchState

func (sf *StateFetcherImpl) FetchState() (vs.State, error)

type StateImpl

type StateImpl struct {
	ledger.QueryExecutor
}

func (*StateImpl) GetStateRangeScanIterator

func (s *StateImpl) GetStateRangeScanIterator(namespace string, startKey string, endKey string) (vs.ResultsIterator, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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