Documentation
¶
Overview ¶
Package cache provides Redis client wrapper for caching operations.
Index ¶
- Constants
- type Cache
- func (c *Cache) Close() error
- func (c *Cache) Decr(ctx context.Context, key string) (int64, error)
- func (c *Cache) Del(ctx context.Context, keys ...string) error
- func (c *Cache) Exists(ctx context.Context, keys ...string) (int64, error)
- func (c *Cache) Expire(ctx context.Context, key string, expiration time.Duration) error
- func (c *Cache) Get(ctx context.Context, key string) (string, error)
- func (c *Cache) Health(ctx context.Context) error
- func (c *Cache) Incr(ctx context.Context, key string) (int64, error)
- func (c *Cache) SAdd(ctx context.Context, key string, members ...interface{}) error
- func (c *Cache) SIsMember(ctx context.Context, key string, member interface{}) (bool, error)
- func (c *Cache) SMembers(ctx context.Context, key string) ([]string, error)
- func (c *Cache) SRem(ctx context.Context, key string, members ...interface{}) error
- func (c *Cache) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
- func (c *Cache) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)
Constants ¶
View Source
const ( KeyUserAvailability = "user:availability:%d" // user:availability:{gitlab_id} KeyUserReviewCount = "user:review_count:%d" // user:review_count:{gitlab_id} KeyUserRecentReviews = "user:recent_reviews:%d" // user:recent_reviews:{gitlab_id} KeyPendingMRs = "mr:pending" // set of "project_id:mr_iid" KeyConfigTeams = "config:teams" // JSON of team configuration )
Cache key constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache wraps Redis client.
Click to show internal directories.
Click to hide internal directories.