Documentation
¶
Index ¶
- type MemoryStore
- func (s *MemoryStore) Delete(ctx context.Context, key string) error
- func (s *MemoryStore) Exists(ctx context.Context, key string) (bool, error)
- func (s *MemoryStore) Get(ctx context.Context, key string) (string, bool, error)
- func (s *MemoryStore) Incr(ctx context.Context, key string, ttl time.Duration) (int64, error)
- func (s *MemoryStore) Set(ctx context.Context, key string, value string, ttl time.Duration) error
- func (s *MemoryStore) SetNX(ctx context.Context, key string, value string, ttl time.Duration) (bool, error)
- func (s *MemoryStore) TTL(ctx context.Context, key string) (time.Duration, bool, error)
- type RedisStore
- func (s *RedisStore) Delete(ctx context.Context, key string) error
- func (s *RedisStore) Exists(ctx context.Context, key string) (bool, error)
- func (s *RedisStore) Get(ctx context.Context, key string) (string, bool, error)
- func (s *RedisStore) Incr(ctx context.Context, key string, ttl time.Duration) (int64, error)
- func (s *RedisStore) Set(ctx context.Context, key string, value string, ttl time.Duration) error
- func (s *RedisStore) SetNX(ctx context.Context, key string, value string, ttl time.Duration) (bool, error)
- func (s *RedisStore) TTL(ctx context.Context, key string) (time.Duration, bool, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func NewRedisStore ¶
func NewRedisStore(client redis.Cmdable) *RedisStore
type Store ¶
type Store interface {
Incr(ctx context.Context, key string, ttl time.Duration) (int64, error)
Set(ctx context.Context, key string, value string, ttl time.Duration) error
SetNX(ctx context.Context, key string, value string, ttl time.Duration) (bool, error)
Get(ctx context.Context, key string) (string, bool, error)
Exists(ctx context.Context, key string) (bool, error)
TTL(ctx context.Context, key string) (time.Duration, bool, error)
Delete(ctx context.Context, key string) error
}
Click to show internal directories.
Click to hide internal directories.