tools

package
v0.0.0-...-4cc9216 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLiveRoom

func CheckLiveRoom(liveID int64, l *liveservice.Client) bool

func GenCustomToken

func GenCustomToken(id interface{}, expiresTime int64) (string, error)

func GenToken

func GenToken(uid int64) (string, error)

func GetUID

func GetUID(ctx *app.RequestContext) (int64, error)

func Md5

func Md5(str string, salt string) string

Types

type CircularBuffer

type CircularBuffer struct {
	// contains filtered or unexported fields
}

func NewCircularBuffer

func NewCircularBuffer(size int) *CircularBuffer

func (*CircularBuffer) Add

func (cb *CircularBuffer) Add(timestamp int64)

func (*CircularBuffer) Count

func (cb *CircularBuffer) Count() int

func (*CircularBuffer) RemoveExpired

func (cb *CircularBuffer) RemoveExpired(expirationTime int64)

type CustomClaims

type CustomClaims struct {
	ID interface{}
	jwt.RegisteredClaims
}

func ParseCustomToken

func ParseCustomToken(tokenStr string) (*CustomClaims, error)

type Limiter

type Limiter struct {
	// contains filtered or unexported fields
}

func NewLimiter

func NewLimiter(interval time.Duration, limit int) *Limiter

func (*Limiter) ShouldSendWord

func (l *Limiter) ShouldSendWord(word string) bool

type MyClaims

type MyClaims struct {
	Uid int64
	jwt.RegisteredClaims
}

func ParseToken

func ParseToken(tokenStr string) (*MyClaims, error)

Jump to

Keyboard shortcuts

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