Ai
11 Star 11 Fork 0

Gitee 极速下载/goa

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/goadesign/goa
克隆/下载
grpc.go 954 Bytes
一键复制 编辑 原始数据 按行查看 历史
Nitin 提交于 2019-01-14 06:51 +08:00 . Add support for gRPC expressions (#1954)
package expr
type (
// GRPCExpr contains the API level gRPC specific expressions.
GRPCExpr struct {
// Services contains the gRPC services created by the DSL.
Services []*GRPCServiceExpr
// Errors lists the error gRPC error responses defined globally.
Errors []*GRPCErrorExpr
}
)
// Service returns the service with the given name if any.
func (g *GRPCExpr) Service(name string) *GRPCServiceExpr {
for _, res := range g.Services {
if res.Name() == name {
return res
}
}
return nil
}
// ServiceFor creates a new or returns the existing service definition for
// the given service.
func (g *GRPCExpr) ServiceFor(s *ServiceExpr) *GRPCServiceExpr {
if res := g.Service(s.Name); res != nil {
return res
}
res := &GRPCServiceExpr{
ServiceExpr: s,
}
g.Services = append(g.Services, res)
return res
}
// EvalName returns the name printed in case of evaluation error.
func (g *GRPCExpr) EvalName() string {
return "API GRPC"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/goa.git
git@gitee.com:mirrors/goa.git
mirrors
goa
goa
v2.2.5

搜索帮助