utils

package
v0.0.0-...-9a10c2a Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWT

func GenerateJWT(userID uint) (string, error)

func GenerateVerificationCode

func GenerateVerificationCode(length int) string

func HealthCheck

func HealthCheck(app *fiber.App)

func SendErrorResponse

func SendErrorResponse(c *fiber.Ctx, status int, message string) error

func SendResponse

func SendResponse(c *fiber.Ctx, status int, message string, data interface{}) error

func SendVerificationSMS

func SendVerificationSMS(phoneNumber, token string) error

func ValidatePhoneNumber

func ValidatePhoneNumber(phone string) bool

Types

type Claims

type Claims struct {
	UserID uint `json:"user_id"`
	jwt.StandardClaims
}

func ParseJWT

func ParseJWT(tokenStr string) (*Claims, error)

type Response

type Response struct {
	Status  string      `json:"status"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
	Meta    interface{} `json:"meta,omitempty"`
}

Jump to

Keyboard shortcuts

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