Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ValkeyDataCache ¶
type ValkeyDataCache[K comparable, V []byte] struct { // contains filtered or unexported fields }
ValkeyDataCache is a cache that relies on valkey. It uses generics so that users of it can uses any type of data they want. The key K must be of type comparable. More infomration here: https://go.dev/blog/comparable The value V can be any type.
func NewValkeyDataCache ¶
func NewValkeyDataCache[K comparable, V []byte]( keyPrefix string, host string, port string, ttl time.Duration) (*ValkeyDataCache[K, V], error)
NewValkeyDataCache creates a new ValkeyDataCache instance.
func (*ValkeyDataCache[K, V]) Cache ¶
func (c *ValkeyDataCache[K, V]) Cache( ctx context.Context, key K, in V, options ...cachetypes.CacheOption, ) error
Cache stores a value in the cache.
Click to show internal directories.
Click to hide internal directories.