engines

package
v0.13.6-0...-d3ad96a Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddServiceLoader

func AddServiceLoader(f ServiceLoader)

AddServiceLoader 添加引擎加载器

Types

type IServiceEngine

type IServiceEngine interface {
	GetRegistry() registry.IRegistry
	GetServices() []string
	Fallback(c *context.Context) (rs interface{})
	Execute(ctx *context.Context) (rs interface{})
	Close() error
}

IServiceEngine 服务引擎接口

type ServiceEngine

ServiceEngine 服务引擎

func NewServiceEngine

func NewServiceEngine(conf conf.IServerConf, registryAddr string, log logger.ILogging) (e *ServiceEngine, err error)

NewServiceEngine 构建服务引擎

func (*ServiceEngine) Close

func (r *ServiceEngine) Close() error

Close 关闭引擎

func (*ServiceEngine) Execute

func (r *ServiceEngine) Execute(ctx *context.Context) (rs interface{})

Execute 执行外部请求

func (*ServiceEngine) GetLogger

func (r *ServiceEngine) GetLogger() logger.ILogging

func (*ServiceEngine) GetRegistry

func (r *ServiceEngine) GetRegistry() registry.IRegistry

GetRegistry 获取注册中心

func (*ServiceEngine) GetServices

func (r *ServiceEngine) GetServices() map[string][]string

GetServices 获取组件提供的所有服务

func (*ServiceEngine) GetTags

func (r *ServiceEngine) GetTags(name string) []string

GetTags 添加获和取tag接口

func (*ServiceEngine) Handling

func (r *ServiceEngine) Handling(ctx *context.Context) (rs interface{})

Handling 每次handle执行前执行

func (*ServiceEngine) LoadComponents

func (r *ServiceEngine) LoadComponents(files ...string) error

LoadComponents 加载所有插件

func (*ServiceEngine) RPCProxy

func (r *ServiceEngine) RPCProxy() component.ServiceFunc

RPCProxy rpc 代理服务

func (*ServiceEngine) SetHandler

SetHandler 设置handler

func (*ServiceEngine) UpdateVarConf

func (r *ServiceEngine) UpdateVarConf(conf conf.IServerConf)

UpdateVarConf 更新var配置参数

type ServiceLoader

type ServiceLoader func(r *component.StandardComponent, i component.IContainer) error

ServiceLoader 服务加载器

Jump to

Keyboard shortcuts

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