redis

package
v0.0.0-...-7706d81 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const UserEmailModule string = "user:email"

Redis module name.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisRepository

type RedisRepository struct {
	User User
	// contains filtered or unexported fields
}

Redis repository structure.

func NewRedisRepository

func NewRedisRepository(cfg config.RedisConfig) *RedisRepository

Creating a new redis repository.

func (*RedisRepository) Close

func (r *RedisRepository) Close()

Closing Redis client connection.

type User

type User interface {
	// Creating a new user verification email code.
	CreateByEmail(ctx context.Context, email string, code uint64, ttl time.Duration) error
	// Getting a user verification email code.
	GetByEmail(ctx context.Context, email string) (uint64, error)
}

User code repository interface.

type UserRepository

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

User code repository structure.

func NewUserRepository

func NewUserRepository(redis redis.Redis) *UserRepository

Creating a new user code repository.

func (*UserRepository) CreateByEmail

func (r *UserRepository) CreateByEmail(ctx context.Context, email string, code uint64, ttl time.Duration) error

Creating a new user verification email code.

func (*UserRepository) GetByEmail

func (r *UserRepository) GetByEmail(ctx context.Context, email string) (uint64, error)

Getting a user verification email code.

Jump to

Keyboard shortcuts

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