Documentation ¶
Index ¶
- type Config
- type HandlerConfig
- type HandlerLibrary
- func (r *HandlerLibrary) DefaultAuth() auth.Filter
- func (r *HandlerLibrary) DefaultDecorator() decoration.Decorator
- func (r *HandlerLibrary) DefaultEndorsement() endorsement.PluginFactory
- func (r *HandlerLibrary) DefaultValidation() validation.PluginFactory
- func (r *HandlerLibrary) ExpirationCheck() auth.Filter
- type HandlerType
- type PluginMapping
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { AuthFilters []*HandlerConfig `mapstructure:"authFilters" yaml:"authFilters"` Decorators []*HandlerConfig `mapstructure:"decorators" yaml:"decorators"` Endorsers PluginMapping `mapstructure:"endorsers" yaml:"endorsers"` Validators PluginMapping `mapstructure:"validators" yaml:"validators"` }
Config configures the factory methods and plugins for the registry
func LoadConfig ¶
type HandlerConfig ¶
type HandlerConfig struct { Name string `mapstructure:"name" yaml:"name"` Library string `mapstructure:"library" yaml:"library"` }
HandlerConfig defines configuration for a plugin or compiled handler
type HandlerLibrary ¶
type HandlerLibrary struct { }
HandlerLibrary is used to assert how to create the various handlers
func (*HandlerLibrary) DefaultAuth ¶
func (r *HandlerLibrary) DefaultAuth() auth.Filter
DefaultAuth creates a default auth.Filter that doesn't do any access control checks - simply forwards the request further. It needs to be initialized via a call to Init() and be passed a peer.EndorserServer
func (*HandlerLibrary) DefaultDecorator ¶
func (r *HandlerLibrary) DefaultDecorator() decoration.Decorator
DefaultDecorator creates a default decorator that doesn't do anything with the input, simply returns the input as output.
func (*HandlerLibrary) DefaultEndorsement ¶
func (r *HandlerLibrary) DefaultEndorsement() endorsement.PluginFactory
func (*HandlerLibrary) DefaultValidation ¶
func (r *HandlerLibrary) DefaultValidation() validation.PluginFactory
func (*HandlerLibrary) ExpirationCheck ¶
func (r *HandlerLibrary) ExpirationCheck() auth.Filter
ExpirationCheck is an auth filter which blocks requests from identities with expired x509 certificates
type HandlerType ¶
type HandlerType int
HandlerType defines custom handlers that can filter and mutate objects passing within the peer
const ( // Auth handler - reject or forward proposals from clients Auth HandlerType = iota // Decoration handler - append or mutate the chaincode input // passed to the chaincode Decoration Endorsement Validation )
type PluginMapping ¶
type PluginMapping map[string]*HandlerConfig
PluginMapping stores a map between chaincode id to plugin config
type Registry ¶
type Registry interface { // Lookup returns a handler with a given // registered name, or nil if does not exist Lookup(HandlerType) interface{} }
Registry defines an object that looks up handlers by name
func InitRegistry ¶
InitRegistry creates the (only) instance of the registry