Documentation ¶
Index ¶
- Constants
- Variables
- func CSRFCheck() gin.HandlerFunc
- func CSRFInit() gin.HandlerFunc
- func CacheControl() gin.HandlerFunc
- func CaptchaRequired(configName string) gin.HandlerFunc
- func CasbinCheckPermission(userID, url, methodtype string) (bool, error)
- func CasbinMiddleware(skipper ...SkipperFunc) gin.HandlerFunc
- func CheckUrlLimit(r *ratelimit.Rule, item string) (err error)
- func ContextWithSpan(c *gin.Context) (ctx context.Context, ok bool)
- func CurrentUser() gin.HandlerFunc
- func DisableLog() core.HandlerFunc
- func HashID(IDType int) gin.HandlerFunc
- func Init(urls []string)
- func JWTAuth(skipper ...SkipperFunc) gin.HandlerFunc
- func ManualEmptyVisitorRecord(c *gin.Context)
- func NewTracer(servicename string, addr string) (opentracing.Tracer, io.Closer, error)
- func NoMethodHandler() gin.HandlerFunc
- func NoRouteHandler() gin.HandlerFunc
- func OBSAuth(skipper ...SkipperFunc) gin.HandlerFunc
- func OSSCallbackAuth() gin.HandlerFunc
- func RateLimit(skipper ...SkipperFunc) gin.HandlerFunc
- func RecoveryMiddleware() gin.HandlerFunc
- func RecoveryMiddlewareOld() gin.HandlerFunc
- func Session(secret string) gin.HandlerFunc
- func SetSamplingFrequency(n int)
- func SignMiddleware(headerKeys []string, urlStr string) gin.HandlerFunc
- func SignMiddlewareV2(headerKeys []string, bodyBytes []byte) gin.HandlerFunc
- func TracerWrapper(c *gin.Context)
- func UseUploadSession(policyType string) gin.HandlerFunc
- type AdminUserRole
- type LimitObj
- type SkipperFunc
Constants ¶
View Source
const ( PrefixUserID = "u_" PrefixRoleID = "r_" )
View Source
const (
CallbackFailedStatusCode = http.StatusUnauthorized
)
Variables ¶
View Source
var AllUrls []string
View Source
var IpLimit []LimitObj
View Source
var Store memstore.Store
Store session存储
View Source
var UserLimit []LimitObj
Functions ¶
func CaptchaRequired ¶
func CaptchaRequired(configName string) gin.HandlerFunc
CaptchaRequired 验证请求签名
func CasbinCheckPermission ¶
检查用户是否有权限
func CasbinMiddleware ¶
func CasbinMiddleware(skipper ...SkipperFunc) gin.HandlerFunc
CasbinMiddleware casbin中间件
func ContextWithSpan ¶
ContextWithSpan 返回context
func DisableLog ¶
func DisableLog() core.HandlerFunc
func OBSAuth ¶
func OBSAuth(skipper ...SkipperFunc) gin.HandlerFunc
func RateLimit ¶
func RateLimit(skipper ...SkipperFunc) gin.HandlerFunc
func RecoveryMiddleware ¶
func RecoveryMiddleware() gin.HandlerFunc
func RecoveryMiddlewareOld ¶
func RecoveryMiddlewareOld() gin.HandlerFunc
func SetSamplingFrequency ¶
func SetSamplingFrequency(n int)
SetSamplingFrequency 设置采样频率 0 <= n <= 100
func SignMiddleware ¶
func SignMiddleware(headerKeys []string, urlStr string) gin.HandlerFunc
SignMiddleware 生成签名中间件函数 headerKeys 不同接口对应不同请求头,需查看 财务云 接口文件进行传输
func SignMiddlewareV2 ¶
func SignMiddlewareV2(headerKeys []string, bodyBytes []byte) gin.HandlerFunc
SignMiddleware 生成签名中间件函数 headerKeys 不同接口对应不同请求头,需查看 财务云 接口文件进行传输
Types ¶
type AdminUserRole ¶
type SkipperFunc ¶
SkipperFunc 定义中间件跳过函数
func AllowPathPrefixNoSkipper ¶
func AllowPathPrefixNoSkipper(prefixes ...string) SkipperFunc
AllowPathPrefixNoSkipper 检查请求路径是否包含指定的前缀,如果包含则不跳过
func AllowPathPrefixSkipper ¶
func AllowPathPrefixSkipper(prefixes ...string) SkipperFunc
AllowPathPrefixSkipper 检查请求路径是否包含指定的前缀,如果包含则跳过
Source Files ¶
Click to show internal directories.
Click to hide internal directories.