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.
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 ¶
Getting a user verification email code.
Click to show internal directories.
Click to hide internal directories.