Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func HashPassword(password string) (string, error)
- func InitOtpExpiryIndex(collection *mongo.Collection) error
- func ValidateToken(token string, secretKey string) (*jwt.Token, error)
- type AccessDetails
- type EmailManager
- type MediaCloudManager
- type OTP
- type OTPManager
- func (ou *OTPManager) DeleteOTP(email string) error
- func (ou *OTPManager) GenerateForgotPasswordOTP(email string) (string, error)
- func (ou *OTPManager) GenerateSignUpOTP(email string) (string, error)
- func (ou *OTPManager) VerifyForgotPasswordOTP(email, otpStr string) (bool, error)
- func (ou *OTPManager) VerifySignUpOTP(email, otpStr string) (bool, error)
- type RefreshDetails
- type TokenDetails
- type TokenManager
- func (tu *TokenManager) DeleteToken(uuid string) error
- func (tu *TokenManager) FindToken(uuid string) (string, error)
- func (tu *TokenManager) GenerateToken(userId primitive.ObjectID) (*TokenDetails, error)
- func (tu *TokenManager) IdentifyUser(refreshToken string) (*RefreshDetails, error)
- func (tu *TokenManager) SaveToken(userId primitive.ObjectID, td *TokenDetails) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
func HashPassword ¶
func InitOtpExpiryIndex ¶
func InitOtpExpiryIndex(collection *mongo.Collection) error
func ValidateToken ¶
Types ¶
type AccessDetails ¶
func ExtractTokenDetails ¶
func ExtractTokenDetails(token *jwt.Token) (*AccessDetails, error)
type EmailManager ¶
func NewEmailManager ¶
func NewEmailManager(senderEmail, senderName, apiKey string) *EmailManager
func (*EmailManager) SendAccountVerificationEmail ¶
func (eu *EmailManager) SendAccountVerificationEmail(email, firstname, otp string) error
func (*EmailManager) SendResetPasswordEmail ¶
func (eu *EmailManager) SendResetPasswordEmail(email, firstname, otp string) error
type MediaCloudManager ¶
type MediaCloudManager struct {
// contains filtered or unexported fields
}
func NewMediaCloudManager ¶
func NewMediaCloudManager(api_uri, folder string) (*MediaCloudManager, error)
func (*MediaCloudManager) DeleteImageBySecureURL ¶
func (mcm *MediaCloudManager) DeleteImageBySecureURL(ctx context.Context, secureUrl string) *mediaErrors.AppError
func (*MediaCloudManager) UploadImage ¶
func (mcm *MediaCloudManager) UploadImage(ctx context.Context, files []*multipart.FileHeader, collection string) ([]string, *mediaErrors.AppError)
type OTP ¶
type OTP struct { ID primitive.ObjectID `json:"id" bson:"_id,omitempty"` Email string `json:"email" bson:"email"` URL string `json:"url" bson:"url"` Secret string `json:"secret" bson:"secret"` ExpiresAt time.Time `json:"expires_at" bson:"expires_at"` CreatedAt time.Time `json:"created_at" bson:"created_at"` }
type OTPManager ¶
type OTPManager struct { Issuer string SignUpOtpValidityInSecs uint ForgotPasswordOtpValidityInSecs uint // contains filtered or unexported fields }
func NewOTPManager ¶
func NewOTPManager(collection *mongo.Collection, issuer string, signUpOtpValidityInSecs, forgotPasswordOtpvalidityInSecs uint) *OTPManager
func (*OTPManager) DeleteOTP ¶
func (ou *OTPManager) DeleteOTP(email string) error
func (*OTPManager) GenerateForgotPasswordOTP ¶
func (ou *OTPManager) GenerateForgotPasswordOTP(email string) (string, error)
func (*OTPManager) GenerateSignUpOTP ¶
func (ou *OTPManager) GenerateSignUpOTP(email string) (string, error)
func (*OTPManager) VerifyForgotPasswordOTP ¶
func (ou *OTPManager) VerifyForgotPasswordOTP(email, otpStr string) (bool, error)
func (*OTPManager) VerifySignUpOTP ¶
func (ou *OTPManager) VerifySignUpOTP(email, otpStr string) (bool, error)
type RefreshDetails ¶
type TokenDetails ¶
type TokenManager ¶
type TokenManager struct {
// contains filtered or unexported fields
}
func NewTokenManager ¶
func NewTokenManager(accessTokensecretKey, refreshTokensecretKey string, accessTokenValidityInMins int64, refreshTokenValidityInHours int64, redisClient *redis.Client) *TokenManager
func (*TokenManager) DeleteToken ¶
func (tu *TokenManager) DeleteToken(uuid string) error
func (*TokenManager) GenerateToken ¶
func (tu *TokenManager) GenerateToken(userId primitive.ObjectID) (*TokenDetails, error)
func (*TokenManager) IdentifyUser ¶
func (tu *TokenManager) IdentifyUser(refreshToken string) (*RefreshDetails, error)
func (*TokenManager) SaveToken ¶
func (tu *TokenManager) SaveToken(userId primitive.ObjectID, td *TokenDetails) error
Click to show internal directories.
Click to hide internal directories.