Documentation ¶
Index ¶
- func BuildMessage(mail Mail) string
- func CheckCreatedDateOfOTP(createdAt time.Time, count int16) (dayCount int16)
- func CheckOtpValidation(userOtp models.EmailOTP) (int64, time.Time, error)
- func CheckPassword(password string, hashedPassword string) error
- func CreateNUllTime(valid bool, value time.Time) sql.NullTime
- func CreateNullBool(valid bool, value bool) sql.NullBool
- func CreateNullInt16(valid bool, value int16) sql.NullInt16
- func CreateNullInt32(valid bool, value int32) sql.NullInt32
- func CreateNullInt64(valid bool, value int64) sql.NullInt64
- func CreateNullString(valid bool, value string) sql.NullString
- func HashPassword(password string) (string, error)
- func IsValidEmail(e string) bool
- func RandomInt(min, max int64) int64
- func RandomOTP() int64
- func SendEmailVerificationCode(param SendEmailVerificationCodeParam) error
- func SetExpirationOfOTP(count int16) (t time.Time, err error)
- func VerifyOTP(reqOtp, dbOtp int64) (b bool, err error)
- func VerifyOTPExpiration(dbOtpExp time.Time) (b bool, err error)
- type Config
- type Mail
- type SendEmailVerificationCodeParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMessage ¶
func CheckCreatedDateOfOTP ¶
func CheckOtpValidation ¶
func CheckPassword ¶
CheckPassword checks if the provided password is correct or not
func CreateNullString ¶
func CreateNullString(valid bool, value string) sql.NullString
func HashPassword ¶
HashedPassword returns the bcrypt hash of the password
func IsValidEmail ¶
func SendEmailVerificationCode ¶
func SendEmailVerificationCode(param SendEmailVerificationCodeParam) error
Types ¶
type Config ¶
type Config struct { DBDriver string `mapstructure:"DB_DRIVER"` DBSource string `mapstructure:"DB_SOURCE"` ServerAddress string `mapstructure:"SERVER_ADDRESS"` TokenSymmetricKey string `mapstructure:"TOKEN_SYMMETRIC_KEY"` AccessTokenDuration time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"` RefreshTokenDuration time.Duration `mapstructure:"REFRESH_TOKEN_DURATION"` CountryStateAPIToken string `mapstructure:"COUNTRY_STATE_API_TOKEN"` SendInBlueKey string `mapstructure:"SEND_IN_BLUE_KEY"` SendInBlueEmail string `mapstructure:"SEND_IN_BLUE_EMAIL"` SenderEmail string `mapstructure:"SENDER_EMAIL"` SendInBluePassword string `mapstructure:"SEND_IN_BLUE_PASSWORD"` SMTPHost string `mapstructure:"SMTP_HOST"` }
func LoadConfig ¶
Click to show internal directories.
Click to hide internal directories.