Documentation ¶
Index ¶
- Variables
- func CheckDuplicateFields(ctx context.Context, email *string, phone *string) (bool, error)
- func FindUserByEmail(ctx context.Context, email *string, user *models.User) error
- func FindUserByID(ctx context.Context, userId string, user *models.User) error
- func GenerateAllTokens(email, firstName, lastName, uid string) (string, string, error)
- func GenerateToken(email, firstName, lastName, uid string, duration time.Duration) (string, error)
- func GetNonNilString(s *string, defaultValue string) string
- func GetOrGenerateTokens(user models.User) (string, string, error)
- func GetPaginatedFoodItems(ctx context.Context, skip int64, recordPerPage int64) ([]models.Food, int64, error)
- func GetPaginatedUsers(ctx context.Context, skip int64, recordPerPage int64) ([]models.User, int64, error)
- func GetPaginationParams(c *gin.Context) (int64, int64)
- func HashPassword(password *string) *string
- func InTimeSpan(start, end, check time.Time) bool
- func OrderItemOrderCreator(order models.Order, ctx context.Context) (string, error)
- func RecordExists(ctx context.Context, collection *mongo.Collection, field string, ...) (bool, error)
- func Round(num float64) int
- func ToFixed(num float64, precision int) float64
- func UpdateAccessToken(signedAccessToken, userId string) error
- func UpdateAllTokens(signedAccessToken, signedRefreshToken, userId string) error
- func ValidateToken(tokenStr string) error
- func VerifyPassword(hashedPassword, plainPassword string) (bool, string)
- type SignedDetails
Constants ¶
This section is empty.
Variables ¶
View Source
var JWT_SECRET string = config.GetEnv("JWT_SECRET", "not-so-secret")
Functions ¶
func CheckDuplicateFields ¶
func FindUserByEmail ¶
func GenerateAllTokens ¶
func GenerateToken ¶
func GetNonNilString ¶
func GetPaginatedFoodItems ¶
func GetPaginatedUsers ¶
func HashPassword ¶
func InTimeSpan ¶
func OrderItemOrderCreator ¶
func RecordExists ¶
func UpdateAccessToken ¶
func UpdateAllTokens ¶
func ValidateToken ¶
func VerifyPassword ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.