Documentation ¶
Index ¶
- func CertCheck(url string, method string) (bool, int)
- func CheckStatus(resp *http.Response) (gjson.Result, string, int, error)
- func GinAuthInterceptor(tokenSecret string) gin.HandlerFunc
- func SetupGinRouter(runMod string, version string, useAuthInterceptor bool, tokenSecret string) *gin.Engine
- func UseFasthttp(req *models.HttpRequest, resp *models.HttpResponse)
- type ErrCode
- type JsonResult
- type PrometheusServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckStatus ¶
返回Body的内容[]byte,错误的原因string,status int ,以及错误内容
func GinAuthInterceptor ¶
func GinAuthInterceptor(tokenSecret string) gin.HandlerFunc
func SetupGinRouter ¶
func UseFasthttp ¶
func UseFasthttp(req *models.HttpRequest, resp *models.HttpResponse)
Types ¶
type JsonResult ¶
type JsonResult struct { // 错误码 Code int `json:"code"` // 错误描述 Msg string `json:"msg"` // 数据实体 Data interface{} `json:"data"` }
func ErrorMsg ¶
func ErrorMsg(errMsg string) JsonResult
ErrorMsg 返回成功数据 @param errMsg 错误描述 @return JsonResult
func Success ¶
func Success(value interface{}) JsonResult
func SuccessWithMsg ¶
func SuccessWithMsg(msg string) JsonResult
type PrometheusServer ¶
func SetPrometheusServer ¶
func SetPrometheusServer(listenPort int) *PrometheusServer
func (*PrometheusServer) Start ¶
func (ps *PrometheusServer) Start()
Click to show internal directories.
Click to hide internal directories.