Help us shape the future of Go! Take the 2026 Go Developer Survey

httpx

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateETag added in v1.20.2

func GenerateETag(data []byte) string

func HttpResult added in v1.20.2

func HttpResult(ctx *app.RequestContext, resp interface{}, err error)

HttpResult HTTP Result

func ParamErrorFromRequestContext added in v1.20.2

func ParamErrorFromRequestContext(ctx *app.RequestContext) error

ParamErrorFromRequestContext returns the parameter error recorded for ctx.

func ParamErrorResult added in v1.20.2

func ParamErrorResult(ctx *app.RequestContext, err error)

ParamErrorResult Param Error Result

func ShouldBind

func ShouldBind(ctx *app.RequestContext, destination any) error

ShouldBind preserves endpoint request-binding behavior for native Hertz contexts.

Types

type HTTPResult added in v1.20.2

type HTTPResult struct {
	StatusCode int
	Body       interface{}
}

func BuildHTTPResult added in v1.20.2

func BuildHTTPResult(resp interface{}, err error) HTTPResult

func BuildParamErrorResult added in v1.20.2

func BuildParamErrorResult(err error) HTTPResult

type NullJson added in v1.20.2

type NullJson struct{} // @name result.NullJson

type ResponseErrorBean added in v1.20.2

type ResponseErrorBean struct {
	Code uint32 `json:"code"`
	Msg  string `json:"msg"`

} // @name result.ResponseErrorBean

func Error added in v1.20.2

func Error(errCode uint32, errMsg string) *ResponseErrorBean

type ResponseSuccessBean added in v1.20.2

type ResponseSuccessBean struct {
	Code uint32      `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data,omitempty"`

} // @name result.ResponseSuccessBean

func Success added in v1.20.2

func Success(data interface{}) *ResponseSuccessBean

Jump to

Keyboard shortcuts

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