engines

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Engines

func Engines() []string

func Register

func Register(name string, f NewBCEngineFunc)

Types

type BCEngine

type BCEngine interface {
	// 初始化引擎
	Init(*xconf.EnvConf) error
	// 启动引擎(阻塞)
	Run()
	// 退出引擎,需要幂等
	Exit()
}

区块链引擎 考虑到引擎的可扩展性,只约束最基本接口,具体暴露接口可由各引擎实现个性化扩展 各引擎提供类型转换函数,由上层引擎使用者调用引擎提供的类型转换函数转换后使用

func CreateBCEngine

func CreateBCEngine(egName string, envCfg *xconf.EnvConf) (BCEngine, error)

采用工厂模式,对上层统一区块链执行引擎创建操作,方便框架开发 区块链执行引擎注册通过init实现,由应用方选择具体要使用的引擎

type NewBCEngineFunc

type NewBCEngineFunc func() BCEngine

创建engine实例方法

Directories

Path Synopsis
common
统一管理系统引擎和链运行上下文
统一管理系统引擎和链运行上下文
net
xpb

Jump to

Keyboard shortcuts

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