Documentation ¶
Index ¶
- Constants
- func SendErrorMessage(c *gin.Context, code int, errorCode string, errorMsg string)
- func SendMessage(c *gin.Context, code int, success bool, data interface{}, ...)
- func SendSuccessMessage(c *gin.Context, code int, data interface{})
- type CodeGoutResponseUse
- type GoutCli
- func (g *GoutCli) DELETE(url string) *dataflow.DataFlow
- func (g *GoutCli) GET(url string) *dataflow.DataFlow
- func (g *GoutCli) OPTIONS(url string) *dataflow.DataFlow
- func (g *GoutCli) PATCH(url string) *dataflow.DataFlow
- func (g *GoutCli) POST(url string) *dataflow.DataFlow
- func (g *GoutCli) PUT(url string) *dataflow.DataFlow
- func (g *GoutCli) SetSkipVerify(skipVerify bool) *GoutCli
- type GoutError
- type GoutResponseDelete
- type GoutResponseMiddleware
- type ModifyResponseUse
- type Result
Constants ¶
View Source
const ( Failed = "4000" FailedParamsError = "4002" FailedRemoteServiceError = "4001" FailedUnknown = "4003" FailedDecodeError = "4004" AthorizationError = "4005" JsonError = "4006" ResourceNotFound = "4007" LicenseError = "4008" BiddenError = "4009" RoleChangeNeedReLogin = "4010" )
request fail
View Source
const (
SystemError = "9000"
)
system error
Variables ¶
This section is empty.
Functions ¶
func SendErrorMessage ¶
SendErrorMessage select fail
func SendMessage ¶
func SendSuccessMessage ¶
SendSuccessMessage select success and have data
Types ¶
type CodeGoutResponseUse ¶
type CodeGoutResponseUse struct {
// contains filtered or unexported fields
}
CodeGoutResponseUse 按code处理gout请求的response,方法不太公用,先放在这里
func NewCodeGoutResponseUse ¶
func NewCodeGoutResponseUse(codes []int, check ...bool) *CodeGoutResponseUse
func (*CodeGoutResponseUse) ModifyResponse ¶
func (c *CodeGoutResponseUse) ModifyResponse(response *http.Response) error
type GoutCli ¶
type GoutCli struct {
// contains filtered or unexported fields
}
func (*GoutCli) SetSkipVerify ¶
自定义tls证书校验模式
type GoutError ¶
type GoutResponseDelete ¶
type GoutResponseDelete struct{}
func (*GoutResponseDelete) ModifyResponse ¶
func (g *GoutResponseDelete) ModifyResponse(response *http.Response) error
ModifyResponse 删除时 200、202都为成功 https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#delete-secret-v1-core
type GoutResponseMiddleware ¶
type GoutResponseMiddleware struct{}
func (*GoutResponseMiddleware) ModifyResponse ¶
func (gout *GoutResponseMiddleware) ModifyResponse(response *http.Response) error
ModifyResponse 统一对gout请求的response中的code、date字段处理
type ModifyResponseUse ¶
type ModifyResponseUse struct {
// contains filtered or unexported fields
}
func NewModifyResponse ¶
func NewModifyResponse(codes []int) *ModifyResponseUse
func (*ModifyResponseUse) ModifyResponse ¶
func (c *ModifyResponseUse) ModifyResponse(response *http.Response) error
Click to show internal directories.
Click to hide internal directories.