Ai
11 Star 11 Fork 0

Gitee 极速下载/goa

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/goadesign/goa
克隆/下载
funcs.go 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
Nitin 提交于 2019-01-16 03:04 +08:00 . gRPC codegen (#1944)
package codegen
import (
"fmt"
"goa.design/goa/dsl"
)
// statusCodeToGRPCConst produces the standard name for the given gRPC status
// code. If no standard name exists then the string consisting of the code
// integer value is returned.
func statusCodeToGRPCConst(code int) string {
if v, ok := statusCodeToConst[code]; ok {
return fmt.Sprintf("codes.%s", v)
}
return fmt.Sprintf("%d", code)
}
var statusCodeToConst = map[int]string{
dsl.CodeOK: "OK",
dsl.CodeCanceled: "Canceled",
dsl.CodeUnknown: "Unknown",
dsl.CodeInvalidArgument: "InvalidArgument",
dsl.CodeDeadlineExceeded: "DeadlineExceeded",
dsl.CodeNotFound: "NotFound",
dsl.CodeAlreadyExists: "AlreadyExists",
dsl.CodePermissionDenied: "PermissionDenied",
dsl.CodeResourceExhausted: "ResourceExhausted",
dsl.CodeFailedPrecondition: "FailedPrecondition",
dsl.CodeAborted: "Aborted",
dsl.CodeOutOfRange: "OutOfRange",
dsl.CodeUnimplemented: "Unimplemented",
dsl.CodeInternal: "Internal",
dsl.CodeUnavailable: "Unavailable",
dsl.CodeDataLoss: "DataLoss",
dsl.CodeUnauthenticated: "Unauthenticated",
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/goa.git
git@gitee.com:mirrors/goa.git
mirrors
goa
goa
v2.2.5

搜索帮助