1 Star 0 Fork 0

micro-tools/micro

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
module.go 928 Bytes
一键复制 编辑 原始数据 按行查看 历史
545403892 提交于 2023-06-05 23:58 +08:00 . init
package module
import (
"context"
"gitee.com/micro-tools/wf/extend/utils/gmicro/registry"
"gitee.com/micro-tools/wf/os/glog"
"google.golang.org/grpc"
)
type App interface {
Options() Options
Registry() registry.Registry
Run(mods ...Module) error
Logger() *glog.Logger
GetRouteServer(filter string) (ServerSession, error) //获取经过筛选过的服务
Call(ctx context.Context, serviceName string, fnc func(context.Context, *grpc.ClientConn) error) error
}
// ServerSession 服务代理
type ServerSession interface {
GetID() string
GetName() string
GetClient() *grpc.ClientConn
GetApp() App
GetNode() *registry.Node
SetNode(node *registry.Node) (err error)
Call(serviceName string, fnc func(*grpc.ClientConn, context.Context)) error
}
type Module interface {
GetType() string //模块类型
OnDestroy()
OnInit(app App)
Run(closeSig chan bool)
}
type RPCModule interface {
context.Context
Module
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/micro-tools/micro.git
git@gitee.com:micro-tools/micro.git
micro-tools
micro
micro
v1.0.2

搜索帮助