library

package
v0.0.0-...-fbe82ab Latest Latest
Warning

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

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

Documentation

Index

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"`
}

配置配置工厂方法 和注册表插件

type HandlerConfig

type HandlerConfig struct {
	Name    string `mapstructure:"name" yaml:"name"`
	Library string `mapstructure:"library" yaml:"library"`
}

handlerconfig定义插件或已编译处理程序的配置

type HandlerLibrary

type HandlerLibrary struct {
}

handlerLibrary用于断言 如何创建各种处理程序

func (*HandlerLibrary) DefaultAuth

func (r *HandlerLibrary) DefaultAuth() auth.Filter

Debug将创建默认的Auth.Futter。 这不做任何访问控制检查-简单地 进一步转发请求。 它需要通过调用init()进行初始化 并通过peer.背书服务器

func (*HandlerLibrary) DefaultDecorator

func (r *HandlerLibrary) DefaultDecorator() decoration.Decorator

DefaultDecorator创建默认Decorator 这与输入无关,只是 将输入作为输出返回。

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是一个阻止请求的身份验证筛选器 来自具有过期X509证书的标识

type HandlerType

type HandlerType int

handlerType定义可以筛选和变异的自定义处理程序 在对等机中传递的对象

const (
	//授权处理程序-拒绝或转发来自客户端的建议
	Auth HandlerType = iota
	//装饰处理程序-附加或修改链码输入
	//传递到链码
	Decoration
	Endorsement
	Validation
)

type PluginMapping

type PluginMapping map[string]*HandlerConfig

type Registry

type Registry interface {
	//查找返回具有给定
	//注册名称,如果不存在则为零
	Lookup(HandlerType) interface{}
}

注册表定义查找的对象 按名称处理程序

func InitRegistry

func InitRegistry(c Config) Registry

InitRegistry创建(唯一)实例 注册表

Jump to

Keyboard shortcuts

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