phttp

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient added in v1.5.0

func NewClient() *resty.Client

NewClient 构建一个client

func NewRequest added in v1.5.0

func NewRequest() *resty.Request

NewRequest 构建一个请求实例

func OutJson added in v1.1.0

func OutJson(c *gin.Context, obj interface{})

OutJson 定义统一响应json格式内容的方法 obj:interface{} 待响应的内容结构体

func ThrowError added in v1.5.0

func ThrowError(c *gin.Context, err perrors.OutError)

ThrowError err: perrors.OutError 标准错误结构体

func ThrowErrorMsg added in v1.5.0

func ThrowErrorMsg(c *gin.Context, msg string, args ...interface{})

ThrowErrorMsg msg: string 错误信息 args: []interface{} 格式化错误信息对应的参数

Types

This section is empty.

Jump to

Keyboard shortcuts

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