Documentation ¶
Index ¶
- func AddServiceLoader(f ServiceLoader)
- type IServiceEngine
- type ServiceEngine
- func (r *ServiceEngine) Close() error
- func (r *ServiceEngine) Execute(ctx *context.Context) (rs interface{})
- func (r *ServiceEngine) GetLogger() logger.ILogging
- func (r *ServiceEngine) GetRegistry() registry.IRegistry
- func (r *ServiceEngine) GetServices() map[string][]string
- func (r *ServiceEngine) GetTags(name string) []string
- func (r *ServiceEngine) Handling(ctx *context.Context) (rs interface{})
- func (r *ServiceEngine) LoadComponents(files ...string) error
- func (r *ServiceEngine) RPCProxy() component.ServiceFunc
- func (r *ServiceEngine) SetHandler(h component.IComponentHandler) error
- func (r *ServiceEngine) UpdateVarConf(conf conf.IServerConf)
- type ServiceLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
type ServiceEngine struct { *component.StandardComponent conf.IServerConf *rpc.Invoker component.IComponentCache component.IComponentDB component.IComponentInfluxDB component.IComponentQueue component.IComponentGlobalVarObject // contains filtered or unexported fields }
ServiceEngine 服务引擎
func NewServiceEngine ¶
func NewServiceEngine(conf conf.IServerConf, registryAddr string, log logger.ILogging) (e *ServiceEngine, err error)
NewServiceEngine 构建服务引擎
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 ¶
func (r *ServiceEngine) SetHandler(h component.IComponentHandler) error
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 服务加载器
Click to show internal directories.
Click to hide internal directories.