11 Star 11 Fork 0

Gitee 极速下载/goa

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/goadesign/goa
克隆/下载
funcs.go 4.31 KB
一键复制 编辑 原始数据 按行查看 历史
package codegen
import (
"fmt"
"net/http"
)
// statusCodeToHTTPConst produces the standard name for the given HTTP status
// code. If no standard name exists then the string consisting of the code
// integer value is returned.
func statusCodeToHTTPConst(statusCode int) string {
if v, ok := statusCodeToConst[statusCode]; ok {
return fmt.Sprintf("http.%s", v)
}
return fmt.Sprintf("%d", statusCode)
}
var statusCodeToConst = map[int]string{
http.StatusContinue: "StatusContinue",
http.StatusSwitchingProtocols: "StatusSwitchingProtocols",
http.StatusProcessing: "StatusProcessing",
http.StatusOK: "StatusOK",
http.StatusCreated: "StatusCreated",
http.StatusAccepted: "StatusAccepted",
http.StatusNonAuthoritativeInfo: "StatusNonAuthoritativeInfo",
http.StatusNoContent: "StatusNoContent",
http.StatusResetContent: "StatusResetContent",
http.StatusPartialContent: "StatusPartialContent",
http.StatusMultiStatus: "StatusMultiStatus",
http.StatusAlreadyReported: "StatusAlreadyReported",
http.StatusIMUsed: "StatusIMUsed",
http.StatusMultipleChoices: "StatusMultipleChoices",
http.StatusMovedPermanently: "StatusMovedPermanently",
http.StatusFound: "StatusFound",
http.StatusSeeOther: "StatusSeeOther",
http.StatusNotModified: "StatusNotModified",
http.StatusUseProxy: "StatusUseProxy",
http.StatusTemporaryRedirect: "StatusTemporaryRedirect",
http.StatusPermanentRedirect: "StatusPermanentRedirect",
http.StatusBadRequest: "StatusBadRequest",
http.StatusUnauthorized: "StatusUnauthorized",
http.StatusPaymentRequired: "StatusPaymentRequired",
http.StatusForbidden: "StatusForbidden",
http.StatusNotFound: "StatusNotFound",
http.StatusMethodNotAllowed: "StatusMethodNotAllowed",
http.StatusNotAcceptable: "StatusNotAcceptable",
http.StatusProxyAuthRequired: "StatusProxyAuthRequired",
http.StatusRequestTimeout: "StatusRequestTimeout",
http.StatusConflict: "StatusConflict",
http.StatusGone: "StatusGone",
http.StatusLengthRequired: "StatusLengthRequired",
http.StatusPreconditionFailed: "StatusPreconditionFailed",
http.StatusRequestEntityTooLarge: "StatusRequestEntityTooLarge",
http.StatusRequestURITooLong: "StatusRequestURITooLong",
http.StatusUnsupportedMediaType: "StatusUnsupportedMediaType",
http.StatusRequestedRangeNotSatisfiable: "StatusRequestedRangeNotSatisfiable",
http.StatusExpectationFailed: "StatusExpectationFailed",
http.StatusTeapot: "StatusTeapot",
http.StatusUnprocessableEntity: "StatusUnprocessableEntity",
http.StatusLocked: "StatusLocked",
http.StatusFailedDependency: "StatusFailedDependency",
http.StatusUpgradeRequired: "StatusUpgradeRequired",
http.StatusPreconditionRequired: "StatusPreconditionRequired",
http.StatusTooManyRequests: "StatusTooManyRequests",
http.StatusRequestHeaderFieldsTooLarge: "StatusRequestHeaderFieldsTooLarge",
http.StatusUnavailableForLegalReasons: "StatusUnavailableForLegalReasons",
http.StatusInternalServerError: "StatusInternalServerError",
http.StatusNotImplemented: "StatusNotImplemented",
http.StatusBadGateway: "StatusBadGateway",
http.StatusServiceUnavailable: "StatusServiceUnavailable",
http.StatusGatewayTimeout: "StatusGatewayTimeout",
http.StatusHTTPVersionNotSupported: "StatusHTTPVersionNotSupported",
http.StatusVariantAlsoNegotiates: "StatusVariantAlsoNegotiates",
http.StatusInsufficientStorage: "StatusInsufficientStorage",
http.StatusLoopDetected: "StatusLoopDetected",
http.StatusNotExtended: "StatusNotExtended",
http.StatusNetworkAuthenticationRequired: "StatusNetworkAuthenticationRequired",
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/goa.git
git@gitee.com:mirrors/goa.git
mirrors
goa
goa
v2.2.4

搜索帮助