utils

package
v0.0.0-...-0815edb Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(c *fiber.Ctx, e error) error

func CheckRecaptcha

func CheckRecaptcha(secret, response string) error

func Conflict

func Conflict(c *fiber.Ctx, e error, message string) error

func CreateCertificate

func CreateCertificate(v *models.Trademark) (*gofpdf.Fpdf, error)

func FetchDataFromApi

func FetchDataFromApi(keyword string) (map[string]interface{}, error)

func GenerateNewAccessToken

func GenerateNewAccessToken(atm *JWTAccess) (string, error)

func GenerateNewAuthToken

func GenerateNewAuthToken(par *models.JwtAuthModel) (*models.JwtTokenDetails, error)

func GenerateNewRefreshToken

func GenerateNewRefreshToken(rtm *JWTRefresh) (string, error)

func GenerateRegistrationNumber

func GenerateRegistrationNumber() string

func InternalServerError

func InternalServerError(c *fiber.Ctx, e error) error

func NewValidator

func NewValidator() *validator.Validate

func NotFound

func NotFound(c *fiber.Ctx, e error) error

func PrivateKey

func PrivateKey() string

func StartServer

func StartServer(a *fiber.App)

StartServer func for starting a simple server.

func StartServerWithGracefulShutdown

func StartServerWithGracefulShutdown(a *fiber.App)

StartServerWithGracefulShutdown function for starting server with a graceful shutdown.

func TokenValid

func TokenValid(c *fiber.Ctx) error

func TrademarkSimilarity

func TrademarkSimilarity(name string) (bool, error)

func Unauthorized

func Unauthorized(c *fiber.Ctx) error

func UploadFiletoS3

func UploadFiletoS3(user string, file *multipart.FileHeader) (bool, string, error)

func UploadFiletoS3PDF

func UploadFiletoS3PDF(user string, file *gofpdf.Fpdf, v *models.Trademark) (bool, string, error)

func ValidatorError

func ValidatorError(err error) map[string]string

Types

type JWTAccess

type JWTAccess struct {
	AccessUuid uuid.UUID `json:"accessUuid"`
	User       uuid.UUID `json:"userId"`
	Role       int16     `json:"role"`
	jwt.StandardClaims
}

func ExtractTokenMetadata

func ExtractTokenMetadata(c *fiber.Ctx) (*JWTAccess, error)

type JWTRefresh

type JWTRefresh struct {
	RefreshUuid uuid.UUID `json:"refreshUuid"`
	User        uuid.UUID `json:"userId"`
	FirstName   string    `json:"firstName"`
	LastName    string    `json:"lastName"`
	Email       string    `json:"email"`
	Role        int16     `json:"role"`
	jwt.StandardClaims
}

func ExtractRefreshToken

func ExtractRefreshToken(t string) (*JWTRefresh, error)

func ExtractRefreshTokenMetadata

func ExtractRefreshTokenMetadata(c *fiber.Ctx) (*JWTRefresh, error)

type SiteVerifyRequest

type SiteVerifyRequest struct {
	RecaptchaResponse string `json:"g-recaptcha-response"`
}

type SiteVerifyResponse

type SiteVerifyResponse struct {
	Success     bool      `json:"success"`
	Score       float64   `json:"score"`
	Action      string    `json:"action"`
	ChallengeTS time.Time `json:"challenge_ts"`
	Hostname    string    `json:"hostname"`
	ErrorCodes  []string  `json:"error-codes"`
}

Jump to

Keyboard shortcuts

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