helpers

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const CHARSET string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

Variables

View Source
var CurrentTime = func() time.Time {
	return time.Now()
}

Functions

func CustomShortURL added in v1.3.2

func CustomShortURL(key string) string

func GenerateJWT

func GenerateJWT(userId, email string) (string, error)

func Hash

func Hash(p string) (string, error)

func IsValidURL

func IsValidURL(u string) bool

func JwtAuthMiddleware added in v1.5.3

func JwtAuthMiddleware() gin.HandlerFunc

func MakeShortURL

func MakeShortURL() (string, string)

func QueryParamMiddleware added in v1.5.3

func QueryParamMiddleware(param string) gin.HandlerFunc

func RateLimitMiddleware added in v1.5.3

func RateLimitMiddleware(rdb *redis.Client, db *gorm.DB, limit, burst int) gin.HandlerFunc

func RemoveExpiredUrls added in v1.1.2

func RemoveExpiredUrls(db *gorm.DB)

func SendVerify

func SendVerify(email string) (string, error)

func VerifyHash

func VerifyHash(hash string, plain string) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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