memory

package
v0.0.0-...-5b19f94 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisRepository

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

func NewRedisRepository

func NewRedisRepository(redis *redis.Client) *RedisRepository

func (*RedisRepository) Add

func (r *RedisRepository) Add(ctx context.Context, user entity.User) error

func (*RedisRepository) CheckDuplicate

func (r *RedisRepository) CheckDuplicate(ctx context.Context, userQuota string, dataQuota string) (bool, error)

func (*RedisRepository) FlushRedis

func (r *RedisRepository) FlushRedis() error

func (*RedisRepository) GetData

func (r *RedisRepository) GetData(ctx context.Context, dataQuota string) (entity.User, error)

func (*RedisRepository) GetUser

func (r *RedisRepository) GetUser(ctx context.Context, userQuota string) (entity.User, error)

func (*RedisRepository) Pull

func (r *RedisRepository) Pull(ctx context.Context) (entity.User, error)

pull from redis last one

func (*RedisRepository) Push

func (r *RedisRepository) Push(ctx context.Context, user entity.User) error

push to redis

func (*RedisRepository) RemoveAllFromList

func (r *RedisRepository) RemoveAllFromList(ctx context.Context) error

remove all from redis list

func (*RedisRepository) SetUserData

func (r *RedisRepository) SetUserData(ctx context.Context, key string, val any) error

func (*RedisRepository) Update

func (r *RedisRepository) Update(ctx context.Context, user entity.User) error

Jump to

Keyboard shortcuts

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