Documentation
¶
Index ¶
Constants ¶
View Source
const ( // keys for the entry object KEY_DATA = "data" KEY_EXPIREDAT = "expiredAt" KEY_EXPIRATION = "expiration" )
Variables ¶
View Source
var ErrInvalidDataType = errors.New("INVALID_DATA_Type")
View Source
var ErrOtpNotFound = errors.New("OTP_NOT_FOUND")
Functions ¶
func DeleteOTP ¶
// Delete removes the otp entry. If the key is not present, error `ErrOtpNotFound` will be thrown. Caller can ignore error if this is acceptable.
func Init ¶
Init initializes otp manager with provided cache. Subsequent calls will not have any effect after first initialization.
func NewRedisEntry ¶
NewRedisEntry prepares the entry for redis cache. This is required because redis accepts a byte array.
Types ¶
Click to show internal directories.
Click to hide internal directories.