mongo

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoRepository

type MongoRepository struct {
	Collection *mongo.Collection
}

func NewRepository

func NewRepository(c *mongo.Client) (*MongoRepository, error)

func (*MongoRepository) BuildIndexes

func (r *MongoRepository) BuildIndexes(ctx context.Context) error

BuildIndexes builds the indexes for the verification repo.

func (*MongoRepository) Create

Create inserts a new verification attempt in the database.

func (*MongoRepository) Delete

func (c *MongoRepository) Delete(ctx context.Context, userID uuid.UUID, t user.VerificationType) error

Delete removes a verfication attempt from the database.

func (*MongoRepository) Get

func (r *MongoRepository) Get(ctx context.Context, userID uuid.UUID, verificationType user.VerificationType) (*user.VerificationCode, error)

Get fetches a verfication session from the database.

func (*MongoRepository) IncreaseAttempts

func (r *MongoRepository) IncreaseAttempts(ctx context.Context, userID uuid.UUID, t user.VerificationType) error

IncreaseAttempsts increases the verifcation attempt by 1.

Jump to

Keyboard shortcuts

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