Documentation ¶
Index ¶
- Constants
- func CheckSign(sign, appid, path, ts string) (ok bool)
- func File(c *gin.Context, filePath, fileName string)
- func JSON(c *gin.Context, data interface{}, err error)
- func ReadRequestBody(req *http.Request) (bs []byte, err error)
- func Redirect(c *gin.Context, location string)
- func VerifySign(c *gin.Context)
- type CommonRsp
- type Config
- type GinEngine
- type Pager
- type RecoverInfo
Constants ¶
View Source
const ( TypeOctetStream = "application/octet-stream" TypeForm = "application/x-www-form-urlencoded" TypeJson = "application/json" TypeXml = "application/xml" TypeJpg = "image/jpeg" TypePng = "image/png" )
Variables ¶
This section is empty.
Functions ¶
func ReadRequestBody ¶ added in v1.0.16
func VerifySign ¶
VerifySign 验证Sign,签名规则,base64(md5(appid+path+ts)) todo: 当前支持60s验证,后续改成单次验证后即失效
Types ¶
type Config ¶
type Config struct { Addr string `json:"addr" yaml:"addr" toml:"addr"` // addr :8080 ReadTimeout xtime.Duration `json:"read_timeout" yaml:"read_timeout" toml:"read_timeout"` // read_timeout WriteTimeout xtime.Duration `json:"write_timeout" yaml:"write_timeout" toml:"write_timeout"` // write_timeout Debug bool `json:"debug" yaml:"debug" toml:"debug"` // is show log Limiter *limit.Config `json:"limiter" yaml:"limiter" toml:"limiter"` // interface limit Trace *trace.Config `json:"trace" yaml:"trace" toml:"trace"` // jaeger trace config }
type GinEngine ¶
type GinEngine struct { Gin *gin.Engine Tracer *trace.Tracer // contains filtered or unexported fields }
func (*GinEngine) Recovery ¶
func (g *GinEngine) Recovery() gin.HandlerFunc
Recovery gin middleware recovery
Click to show internal directories.
Click to hide internal directories.