otp

package
v0.0.0-...-e31961d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository for otp

func New

func New(redis redis.Redis) *Repository

New otp repo

func (Repository) DeleteAll

func (r Repository) DeleteAll(ctx context.Context, uniqueID string, action authentity.Action) error

DeleteAll otp from a given user with uniqueID and authentication action

func (Repository) DeleteValidateAttempt

func (r Repository) DeleteValidateAttempt(ctx context.Context, uniqueID string) error

DeleteValidateAttempt to delete the attempt of validation this usually happened when people finally able to validate their OTP

func (Repository) GetLast

func (r Repository) GetLast(ctx context.Context, uniqueID string, action authentity.Action) (otpentity.OTP, error)

GetLast OTP

func (Repository) IncreaseValidateAttempt

func (r Repository) IncreaseValidateAttempt(ctx context.Context, uniqueID string, amount int) (int, error)

IncreaseValidateAttempt to increase number when people trying to validate their otp

func (Repository) Len

func (r Repository) Len(ctx context.Context, uniqueID string, action authentity.Action) (int, error)

Len of the otp

func (Repository) Save

func (r Repository) Save(ctx context.Context, otp otpentity.OTP) error

Save the otp

func (Repository) SetLast

func (r Repository) SetLast(ctx context.Context, otp otpentity.OTP) error

SetLast value to wanted otp value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL