1 Star 0 Fork 0

csingo / cRpc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
GrpcClient.go 341 Bytes
一键复制 编辑 原始数据 按行查看 历史
joe 提交于 2023-12-14 16:15 . update
package cRpc
import (
"github.com/gin-gonic/gin"
"google.golang.org/grpc"
)
func GetGrpcClient[C any](ctx *gin.Context, instance RpcClientInterface, f func(cc grpc.ClientConnInterface) C) (client C, err error) {
conn, err := clientContainer.GetGrpcConn(instance.RpcClientName())
if err != nil {
return
}
client = f(conn)
return
}
Go
1
https://gitee.com/csingo/cRpc.git
git@gitee.com:csingo/cRpc.git
csingo
cRpc
cRpc
v0.2.65

搜索帮助