handlers

package
v0.0.0-...-b9171e1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageBadRequest                 = "Bad Request"
	MessageBadRequestInsufficientData = "Bad Request insufficient data"
	MessageAlreadyVerified            = "Already Verified."
	MessageVerificationAlreadyFailed  = "Verification already Failed."
	MessageVerificationFailed         = "Verification Failed."
	MessageUserVerificationSuccess    = "User Verified."
	MessagePasskeyVerificationSuccess = "Passkey Authorised."
	MessageInvalidVerificationCode    = "Verification Code Invalid."
	MessageExpiredVerificationCode    = "Verification Code Expired."
	MessageErrorWhileSendingEmail     = "Error while sending Email. please register again."
	MessageInvalidBody                = "Invalid Body"
	MessageInvalidEmailAddress        = "Invalid Email Address Please use valid Email."
	MessageInvalidPublicKey           = "Invalid PublicKey Please use valid PublicKey."
	MessageError                      = "Message"
)

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(c *gin.Context, message string)

func CreateChallenge

func CreateChallenge(c *gin.Context, db *gorm.DB, data map[string]interface{}, passkey models.Passkey, args ...models.Args) (bool, models.Challenge)

func CreateInDatabase

func CreateInDatabase(c *gin.Context, db *gorm.DB, value interface{}, args ...models.Args) bool

func DeleteInDatabaseById

func DeleteInDatabaseById(db *gorm.DB, idField string, id interface{}, value interface{}) bool

func DeleteUser

func DeleteUser(db *gorm.DB, verification models.Verification) bool

func GetById

func GetById(db *gorm.DB, value interface{}, id interface{}) bool

func InternalServerError

func InternalServerError(c *gin.Context)

func LogReqToDb

func LogReqToDb(c *gin.Context, db *gorm.DB, reqId uuid.UUID, reqStart time.Time)

func MarkVerified

func MarkVerified(c *gin.Context, db *gorm.DB, value interface{}, idField string, id string, updateField string, updateValue bool) bool

func ParseBody

func ParseBody(c *gin.Context, strict bool, keys []string) map[string]interface{}

func ParseBodyNonStrict

func ParseBodyNonStrict(c *gin.Context, keys ...string) map[string]interface{}

func ParseBodyStrict

func ParseBodyStrict(c *gin.Context, keys ...string) map[string]interface{}

func SendVerificationMail

func SendVerificationMail(db *gorm.DB, verification models.Verification) bool

func StatusOK

func StatusOK(c *gin.Context, data interface{}, message string)

func StatusOKPag

func StatusOKPag(c *gin.Context, data interface{}, pag pagination.Pagination, message string)

func TxCommit

func TxCommit(c *gin.Context, tx *gorm.DB) bool

func UnauthorisedRequest

func UnauthorisedRequest(c *gin.Context)

func UpdateField

func UpdateField(db *gorm.DB, value interface{}, idField string, id interface{}, updateField string, updateValue bool) bool

func VerifyNewPasskey

func VerifyNewPasskey(db *gorm.DB, verification models.Verification) bool

func VerifyNewUser

func VerifyNewUser(db *gorm.DB, verification models.Verification) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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