Documentation ¶
Index ¶
- type CacheService
- type RedisCacheService
- func (svc *RedisCacheService) ClearPattern(ctx context.Context, pattern string) (int64, error)
- func (svc *RedisCacheService) Close() error
- func (svc *RedisCacheService) CountKeys(ctx context.Context) (int64, error)
- func (svc *RedisCacheService) Get(ctx context.Context, key string) (string, error)
- func (svc *RedisCacheService) Remove(ctx context.Context, key string) error
- func (svc *RedisCacheService) Set(ctx context.Context, key, value string, expiration time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheService ¶
type CacheService interface { Get(ctx context.Context, key string) (string, error) Set(ctx context.Context, key, value string, expiration time.Duration) error Remove(ctx context.Context, key string) error CountKeys(ctx context.Context) (int64, error) ClearPattern(ctx context.Context, pattern string) (int64, error) Close() error }
type RedisCacheService ¶
type RedisCacheService struct {
// contains filtered or unexported fields
}
RedisCacheService implements CacheService using Redis
func NewRedisCacheService ¶
func NewRedisCacheService(ctx context.Context) (*RedisCacheService, error)
NewRedisCacheService creates a new instance of RedisCacheService
func (*RedisCacheService) ClearPattern ¶
func (*RedisCacheService) Close ¶
func (svc *RedisCacheService) Close() error
Close closes the Redis client
func (*RedisCacheService) CountKeys ¶
func (svc *RedisCacheService) CountKeys(ctx context.Context) (int64, error)
CountKeys counts the number of keys in the Redis cache
Click to show internal directories.
Click to hide internal directories.