ginproxy

package
v0.0.0-...-5591726 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessLog

func AccessLog(c *gin.Context)

func CopyReqBody

func CopyReqBody(c *gin.Context)

func FormatError

func FormatError(c *gin.Context, e *errmsg.ErrMsg)

func GetAlias

func GetAlias(c *gin.Context) string

func GetAppName

func GetAppName(c *gin.Context) string

func GetBoolQuery

func GetBoolQuery(c *gin.Context, query string, defaultValue bool) bool

func GetCtx

func GetCtx(c *gin.Context) context.Context

func GetDeviceId

func GetDeviceId(c *gin.Context) string

func GetFloat64Query

func GetFloat64Query(c *gin.Context, query string, defaultValue float64) float64

func GetInt32Path

func GetInt32Path(c *gin.Context, key string) (int32, error)

func GetInt32Query

func GetInt32Query(c *gin.Context, query string, defaultValue int32) int32

func GetInt64Path

func GetInt64Path(c *gin.Context, key string) (int64, error)

func GetInt64Query

func GetInt64Query(c *gin.Context, query string, defaultValue int64) int64

func GetMeta

func GetMeta(c *gin.Context) *model.RequestMeta

func GetReqBody

func GetReqBody(c *gin.Context) []byte

func GetResp

func GetResp(c *gin.Context) string

func GetTraceId

func GetTraceId(c *gin.Context) string

func GetUserId

func GetUserId(c *gin.Context) int64

func OK

func OK(c *gin.Context)

func ParameterError

func ParameterError(c *gin.Context)

参数错误

func Parse

func Parse(c *gin.Context)

需要在nginx设置 server{ set $trace_id "${request_id}"; if ($http_x_atrace_id != "" ){ set $trace_id "${http_x_atrace_id}"; } add_header trace_id $trace_id; #配置反向代理时使用 proxy_set_header x-atrace-id $trace_id; ... }

func Recovery

func Recovery(c *gin.Context)

func Ret

func Ret(c *gin.Context, resp interface{})

func ServerError

func ServerError(c *gin.Context)

func SetAlias

func SetAlias(c *gin.Context, uri string)

func SetResp

func SetResp(c *gin.Context, val interface{})

Types

type Resp

type Resp struct {
	// 返回的错误码
	Code int32 `json:"code"`
	// 返回的错误信息
	Message string `json:"message,omitempty"`
	// 返回的内容
	Data interface{} `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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