apiutil

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

func CheckHTTPStatus(statusCode int) *errors.Error

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)}

func IsReason

func IsReason(err error, reason Enum) bool

func Sleep

func Sleep(duration time.Duration)

Types

type Enum

type Enum interface {
	String() string
	Number() protoreflect.EnumNumber
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL