Documentation ¶
Index ¶
- Constants
- func AuthGuard(p *AuthGuardPayload) gin.HandlerFunc
- func BodyPipe[T any]() gin.HandlerFunc
- func GenerateToken(claims Claims, secretKey string) (string, error)
- func LogAlarm(p *LogAlarmPayload) gin.HandlerFunc
- func QueryPipe[T any]() gin.HandlerFunc
- func UserAgentPipe() gin.HandlerFunc
- type AlarmTrigger
- type AuthGuardPayload
- type Claims
- type LogAlarmPayload
- type NumericDate
Constants ¶
View Source
const ( CtxQuery = "query" CtxBody = "body" CtxBrowserName = "browserName" CtxDeviceType = "deviceType" CtxOSName = "osName" CtxOSVersion = "osVersion" )
View Source
const ( DeviceTypeDesktop = "desktop" DeviceTypeMobile = "mobile" DeviceTypeTablet = "tablet" DeviceTypeBot = "bot" DeviceTypeUnknown = "unknown" )
View Source
const (
CtxClaims = "claims"
)
Variables ¶
This section is empty.
Functions ¶
func AuthGuard ¶
func AuthGuard(p *AuthGuardPayload) gin.HandlerFunc
AuthGuard http router 判断当前请求权限
path 在白名单时跳过验证,可用“*”模糊匹配
func BodyPipe ¶
func BodyPipe[T any]() gin.HandlerFunc
func LogAlarm ¶
func LogAlarm(p *LogAlarmPayload) gin.HandlerFunc
func QueryPipe ¶
func QueryPipe[T any]() gin.HandlerFunc
func UserAgentPipe ¶
func UserAgentPipe() gin.HandlerFunc
Types ¶
type AlarmTrigger ¶
type AlarmTrigger struct {
WebHook []string
}
type AuthGuardPayload ¶
type LogAlarmPayload ¶
type LogAlarmPayload struct { Trigger AlarmTrigger Params []string }
type NumericDate ¶
type NumericDate = jwt.NumericDate
func NewNumericDate ¶
func NewNumericDate(t time.Time) *NumericDate
Click to show internal directories.
Click to hide internal directories.