Documentation ¶
Index ¶
- Variables
- func AuthAdminMiddleware(ctx *gin.Context)
- func AuthRoom(Authorization string) (*op.User, *op.Room, error)
- func AuthRoomMiddleware(ctx *gin.Context)
- func AuthRootMiddleware(ctx *gin.Context)
- func AuthUser(Authorization string) (*op.User, error)
- func AuthUserMiddleware(ctx *gin.Context)
- func Init(e *gin.Engine)
- func NewAuthRoomToken(user *op.User, room *op.Room) (string, error)
- func NewAuthUserToken(user *op.User) (string, error)
- func NewCors() gin.HandlerFunc
- func NewDistCacheControl(prefix string) gin.HandlerFunc
- func NewLimiter(Period time.Duration, Limit int64, options ...limiter.Option) gin.HandlerFunc
- func NewQuic() gin.HandlerFunc
- type AuthClaims
- type AuthRoomClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAuthFailed = errors.New("auth failed") ErrAuthExpired = errors.New("auth expired") )
Functions ¶
func AuthAdminMiddleware ¶ added in v0.3.0
func AuthRoomMiddleware ¶ added in v0.3.0
func AuthRootMiddleware ¶ added in v0.3.0
func AuthUserMiddleware ¶ added in v0.3.0
func NewAuthRoomToken ¶ added in v0.3.0
func NewCors ¶
func NewCors() gin.HandlerFunc
func NewDistCacheControl ¶ added in v0.3.0
func NewDistCacheControl(prefix string) gin.HandlerFunc
func NewLimiter ¶ added in v0.3.0
func NewQuic ¶
func NewQuic() gin.HandlerFunc
Types ¶
type AuthClaims ¶ added in v0.2.4
type AuthClaims struct { UserId string `json:"u"` jwt.RegisteredClaims }
type AuthRoomClaims ¶ added in v0.3.0
type AuthRoomClaims struct { AuthClaims RoomId string `json:"r"` Version uint32 `json:"rv"` }
Click to show internal directories.
Click to hide internal directories.