Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisClientInterface ¶
type RedisClientInterface interface { Get(ctx context.Context, key string) *redis.StringCmd Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd }
RedisClientInterface defines the interface for interacting with Redis.
type RedisLoginCheckRepository ¶
type RedisLoginCheckRepository struct {
// contains filtered or unexported fields
}
RedisLoginCheckRepository is a repository implementation that uses Redis for login time checks.
func NewLoginCheckRepository ¶
func NewLoginCheckRepository(client RedisClientInterface) *RedisLoginCheckRepository
NewLoginCheckRepository creates a new instance of RedisLoginCheckRepository.
func (*RedisLoginCheckRepository) GetLoginTime ¶
func (r *RedisLoginCheckRepository) GetLoginTime(ctx context.Context, account string) (time.Time, error)
GetLoginTime retrieves the login time for a given account from Redis. It takes a context and the account as input parameters. It returns the login time as a time.Time value and an error, if any.
func (*RedisLoginCheckRepository) SetLoginTime ¶
SetLoginTime sets the login time for a given account in Redis. It takes a context and the account as input parameters. It returns a boolean indicating whether the operation was successful and an error, if any.