Documentation
¶
Index ¶
- type RedisService
- func (r *RedisService) Delete(ctx context.Context, key string) error
- func (r *RedisService) Expire(ctx context.Context, key string, ttl time.Duration) error
- func (r *RedisService) Get(ctx context.Context, key string) (string, error)
- func (r *RedisService) Set(ctx context.Context, key string, value string, ttl time.Duration) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisService ¶
type RedisService struct {
// contains filtered or unexported fields
}
RedisService represents a simple in-memory Redis-like service.
func NewMockService ¶
func NewMockService() *RedisService
NewRedisService creates a new instance of RedisService.
func (*RedisService) Delete ¶
func (r *RedisService) Delete(ctx context.Context, key string) error
Delete removes a key-value pair from the Redis service.
type Service ¶
type Service interface {
Set(ctx context.Context, key string, value string, ttl time.Duration) error
Get(ctx context.Context, key string) (string, error)
Delete(ctx context.Context, key string) error
Expire(ctx context.Context, key string, ttl time.Duration) error
}
func NewRedisService ¶
func NewRedisService(host string, password sdk.MaskedBytes) Service
Click to show internal directories.
Click to hide internal directories.