Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RetentionMap ¶
func NewRetentionMap ¶
func NewRetentionMap(ctx context.Context, retentionPeriod time.Duration) RetentionMap
NewRetentionMap will create a new retentionmap and start the retention given the set period
func (RetentionMap) NewOTP ¶
func (rm RetentionMap) NewOTP() OTP
NewOTP creates and adds a new otp to the map
func (RetentionMap) Retention ¶
func (rm RetentionMap) Retention(ctx context.Context, retentionPeriod time.Duration)
Retention will make sure old OTPs are removed Is Blocking, so run as a Goroutine
func (RetentionMap) VerifyOTP ¶
func (rm RetentionMap) VerifyOTP(otp string) bool
VerifyOTP will make sure a OTP exists and return true if so It will also delete the key so it cant be reused
Click to show internal directories.
Click to hide internal directories.