middlewares

package
v0.3.0-alpha-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

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 AuthAdminMiddleware(ctx *gin.Context)

func AuthRoom added in v0.2.4

func AuthRoom(Authorization string) (*op.User, *op.Room, error)

func AuthRoomMiddleware added in v0.3.0

func AuthRoomMiddleware(ctx *gin.Context)

func AuthRootMiddleware added in v0.3.0

func AuthRootMiddleware(ctx *gin.Context)

func AuthUser added in v0.3.0

func AuthUser(Authorization string) (*op.User, error)

func AuthUserMiddleware added in v0.3.0

func AuthUserMiddleware(ctx *gin.Context)

func Init

func Init(e *gin.Engine)

func NewAuthRoomToken added in v0.3.0

func NewAuthRoomToken(user *op.User, room *op.Room) (string, error)

func NewAuthUserToken added in v0.3.0

func NewAuthUserToken(user *op.User) (string, error)

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 NewLimiter(Period time.Duration, Limit int64, options ...limiter.Option) gin.HandlerFunc

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL