6 Star 11 Fork 1

distill/distill-infra

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
grpcapi.go 965 Bytes
一键复制 编辑 原始数据 按行查看 历史
胡正阳 提交于 2021-09-16 18:14 . integration the corba and go-restful
package grpcapi
import (
"fmt"
"gitee.com/banyanhouse/distill-infra/apigrpc"
"gitee.com/banyanhouse/distill-infra/core/ServiceImpl"
"gitee.com/banyanhouse/distill-infra/core/Services"
"gitee.com/banyanhouse/distill-infra/register"
"k8s.io/klog/v2"
)
func init() {
apigrpc.RegisterGRpcApi(new(GRpcApi))
}
type GRpcApi struct {
}
func (g *GRpcApi) Init(grpcName, grpcPort string) {
register.GRpcRegister(grpcName, grpcPort)
grpcService := register.GrpcService()
err := Services.RegisterGreeterHandler(grpcService.Server(), new(ServiceImpl.GreeterService))
if err != nil {
klog.Errorf("GRpc Service impl failed:%s\n", err.Error())
}
//go grpcService.Run()
services, err := register.RegistryCenter().ListServices()
if err != nil {
klog.Errorf("get registry service list failed. %s", err.Error())
}
for i, service := range services {
fmt.Printf("%d -----> %s\n", i, service.Name)
}
}
func (g *GRpcApi) Setup(grpcName, grpcPort string) {
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/banyanhouse/distill-infra.git
git@gitee.com:banyanhouse/distill-infra.git
banyanhouse
distill-infra
distill-infra
v0.0.25

搜索帮助