Documentation
¶
Index ¶
- Constants
- Variables
- func AppendReqHeadLog(name ...string) gin.HandlerFunc
- func AppendReqLog(c *gin.Context, k string, v interface{})
- func Cors() gin.HandlerFunc
- func DisableReqBodyLog() gin.HandlerFunc
- func DisableRespBodyLog() gin.HandlerFunc
- func EnableGinLog() gin.HandlerFunc
- func Fail(c *gin.Context)
- func FailWithData(c *gin.Context, ResData interface{})
- func FailWithDetailed(c *gin.Context, ResCode ResCode, ResMsg interface{}, ResData interface{})
- func FailWithMessage(c *gin.Context, ResMsg interface{})
- func Get(url string) ([]byte, error)
- func GetGinContextReqId(c *gin.Context) string
- func HttpStringResult(result []byte, err error) (string, error)
- func Middleware_SetReqId() gin.HandlerFunc
- func NewGin() *gin.Engine
- func NewHttpClient(method http_method, url string, req_body []byte) *http_client
- func NewHttpClientWithFile(url string, filename string, fh io.Reader, size int64) (*http_client, error)
- func NewHttpClientWithJson(method http_method, url string, req_body interface{}) (*http_client, error)
- func NoFindResult(c *gin.Context)
- func Ok(c *gin.Context)
- func OkDetailed(c *gin.Context, ResMsg interface{}, ResData interface{})
- func OkWithData(c *gin.Context, ResData interface{})
- func OkWithMessage(c *gin.Context, ResMsg interface{})
- func Post(url, contentType string, req_body []byte) ([]byte, error)
- func PostWithForm(url string, req_body map[string]string) (result []byte, err error)
- func PostWithJson(url string, req_body interface{}) (result []byte, err error)
- func RecoverHandler(c *gin.Context)
- func Result(c *gin.Context, ResCode ResCode, ResMsg interface{}, ResData interface{})
- func RewriteReqBody(c *gin.Context, body []byte)
- type BasePageModel
- type ResCode
- type Response
Constants ¶
View Source
const ( //最大打印gin resp_body长度 1mb MAX_PRINT_GIN_RESP_BODY_LEN = 1048576 //最大打印gin req_body 长度 MAX_PRINT_GIN_REQ_BODY_LEN = 1048576 )
Variables ¶
View Source
var ( GET http_method = "GET" POST http_method = "POST" DELETE http_method = "DELETE" PUT http_method = "PUT" )
Functions ¶
func AppendReqLog ¶
func FailWithData ¶
func FailWithDetailed ¶
func FailWithMessage ¶
func GetGinContextReqId ¶
func HttpStringResult ¶
转化http返回值为string
func Middleware_SetReqId ¶ added in v0.0.19
func Middleware_SetReqId() gin.HandlerFunc
func NewHttpClient ¶
func NewHttpClientWithFile ¶
func NewHttpClientWithFile(url string, filename string, fh io.Reader, size int64) (*http_client, error)
todo 提取file部分代码
func NewHttpClientWithJson ¶
func NoFindResult ¶
func OkDetailed ¶
func OkWithData ¶
func OkWithMessage ¶
func PostWithForm ¶
func PostWithJson ¶
Types ¶
type BasePageModel ¶
type BasePageModel struct {
Data interface{} `json:"data"`
Count int64 `json:"count"`
}
Click to show internal directories.
Click to hide internal directories.