utils

package
v0.0.0-...-fc1d228 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallBSC

func CallBSC(context *fiber.Ctx) (string, error)

func GeneratePasswordRecoveryToken

func GeneratePasswordRecoveryToken(recoveryType string, id uint) (string, error)

func GenerateRandomNumber

func GenerateRandomNumber(rnd *rand.Rand, min, max int) int

func GenerateUserToken

func GenerateUserToken(address string, userID uint) (string, error)

func GetEnvVariable

func GetEnvVariable(key string) string

func GetNodeName

func GetNodeName(context *fiber.Ctx, index uint) string

func NewSHA256

func NewSHA256(data []byte) []byte

func ParseAndValidateRequestBody

func ParseAndValidateRequestBody(context *fiber.Ctx, object interface{}) error

func ReturnErrorResponse

func ReturnErrorResponse(status int, err error, context *fiber.Ctx) error

func ReturnSuccessResponse

func ReturnSuccessResponse(context *fiber.Ctx) error

Types

type UserTokenClaims

type UserTokenClaims struct {
	ID      uint
	Address string
	Exp     uint
}

func GetUserTokenClaims

func GetUserTokenClaims(context *fiber.Ctx) (*UserTokenClaims, error)

Jump to

Keyboard shortcuts

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