Documentation ¶
Index ¶
- func CheckAPIResponse(response clientutil.Response, err error) *errors.Error
- func CheckHTTPResponse(httpCode int, response clientutil.Response) *errors.Error
- func CheckHTTPStatus(statusCode int) *errors.Error
- func CheckResponseCode(response clientutil.Response) *errors.Error
- func CheckResponseStatus(resp clientutil.Response) *errors.Error
- func IsReason(err error, reason Enum) bool
- func Sleep(duration time.Duration)
- type Enum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAPIResponse ¶
func CheckAPIResponse(response clientutil.Response, err error) *errors.Error
func CheckHTTPResponse ¶
func CheckHTTPResponse(httpCode int, response clientutil.Response) *errors.Error
CheckHTTPResponse 请不要使用 err = CheckHTTPResponse 函数,因为这个函数返回的是 *errors.Error,而 err = CheckHTTPResponse 返回的是 error 请使用 if e := CheckHTTPResponse(response); e != nil {return errorpkg.WithStack(err)}
func CheckHTTPStatus ¶
CheckHTTPStatus 请不要使用 err = CheckHTTPStatus 函数,因为这个函数返回的是 *errors.Error,而 err = CheckHTTPStatus 返回的是 error 请使用 if e := CheckHTTPStatus(response); e != nil {return errorpkg.WithStack(err)}
func CheckResponseCode ¶
func CheckResponseCode(response clientutil.Response) *errors.Error
CheckResponseCode 请不要使用 err = CheckResponseCode 函数,因为这个函数返回的是 *errors.Error,而 err = CheckResponseCode 返回的是 error 请使用 if e := CheckResponseCode(response); e != nil {return errorpkg.WithStack(err)}
func CheckResponseStatus ¶
func CheckResponseStatus(resp clientutil.Response) *errors.Error
CheckResponseStatus 请不要使用 err = CheckResponseStatus 函数,因为这个函数返回的是 *errors.Error,而 err = CheckResponseStatus 返回的是 error 请使用 if e := CheckResponseStatus(response); e != nil {return errorpkg.WithStack(err)}
Types ¶
type Enum ¶
type Enum interface { String() string Number() protoreflect.EnumNumber }