Documentation ¶ Index ¶ type Cache func NewCache[T any](client *redis.Client, topic string) *Cache[T] func (e *Cache[T]) Get(ctx context.Context, key string) (T, bool) func (e *Cache[T]) GetRecheckKeys(ctx context.Context) []string func (e *Cache[T]) LocalKeys() []string func (e *Cache[T]) SetTTL(ctx context.Context, key string, value T, ttl1 time.Duration, ...) error type Item Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Cache ¶ type Cache[T any] struct { RedisTimeout time.Duration // contains filtered or unexported fields } func NewCache ¶ func NewCache[T any](client *redis.Client, topic string) *Cache[T] func (*Cache[T]) Get ¶ func (e *Cache[T]) Get(ctx context.Context, key string) (T, bool) func (*Cache[T]) GetRecheckKeys ¶ func (e *Cache[T]) GetRecheckKeys(ctx context.Context) []string func (*Cache[T]) LocalKeys ¶ func (e *Cache[T]) LocalKeys() []string func (*Cache[T]) SetTTL ¶ func (e *Cache[T]) SetTTL(ctx context.Context, key string, value T, ttl1 time.Duration, ttl2 time.Duration) error type Item ¶ type Item[T any] struct { Value T ExpiresAt time.Time RecheckAt time.Time } Source Files ¶ View all Source files ecache.go Click to show internal directories. Click to hide internal directories.