validation

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument interface {
	Dependency
	//arg返回参数的字节数
	Arg() []byte
}

参数定义用于验证的参数

type ContextDatum

type ContextDatum interface{}

ContextDatum定义从验证器传递的附加数据 进入validate()调用

type Dependency

type Dependency interface{}

依赖项标记传递给init()方法的依赖项

type ExecutionFailureError

type ExecutionFailureError struct {
	Reason string
}

ExecutionFailureError指示验证 由于执行问题而失败,因此 无法计算事务验证状态

func (*ExecutionFailureError) Error

func (e *ExecutionFailureError) Error() string

错误表示这是一个错误,并且还包含 错误的原因

type Plugin

type Plugin interface {
	//如果在事务内部给定位置的操作,则validate返回nil
	//在给定的位置,在给定的块中是有效的,否则是错误的。
	Validate(block *common.Block, namespace string, txPosition int, actionPosition int, contextData ...ContextDatum) error

	//init将依赖项插入插件的实例中
	Init(dependencies ...Dependency) error
}

插件验证事务

type PluginFactory

type PluginFactory interface {
	New() Plugin
}

PluginFactory创建插件的新实例

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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