Documentation ¶
Index ¶
- func PrivateMiddleware(passcode string) gin.HandlerFunc
- func ProtectedMiddleWare(extractionKey string, accessKey string, validateToken Validate, ...) gin.HandlerFunc
- func PublicMiddleWare(extractionKey string, restKey string, validateToken PublicValidate, ...) gin.HandlerFunc
- type HandleMiddleWare
- type JwtClaim
- type MiddlewareType
- type MiddlewareValue
- type PublicClaim
- type PublicValidate
- type Validate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrivateMiddleware ¶
func PrivateMiddleware(passcode string) gin.HandlerFunc
func ProtectedMiddleWare ¶
func ProtectedMiddleWare(extractionKey string, accessKey string, validateToken Validate, sugarLogger *zap.SugaredLogger) gin.HandlerFunc
func PublicMiddleWare ¶
func PublicMiddleWare(extractionKey string, restKey string, validateToken PublicValidate, sugarLogger *zap.SugaredLogger) gin.HandlerFunc
Types ¶
type HandleMiddleWare ¶
type MiddlewareType ¶
type MiddlewareType string
const ( Protected MiddlewareType = "protected" Public MiddlewareType = "public" Private MiddlewareType = "private" )
type MiddlewareValue ¶
type MiddlewareValue struct { MiddlewareType MiddlewareType UserID int64 DeviceID string IdentityKey string }
func (*MiddlewareValue) GetMiddlewareValue ¶
func (mv *MiddlewareValue) GetMiddlewareValue(ctx *gin.Context) rest_errors.RestError
type PublicClaim ¶
type PublicClaim struct { Key string jwt.RegisteredClaims }
type PublicValidate ¶
type PublicValidate func(token string, secret string) (*PublicClaim, rest_errors.RestError)
Click to show internal directories.
Click to hide internal directories.