ecache

package
v0.0.0-...-9f66e43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL