redisutil

package
v0.0.0-...-122f59b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 4 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 struct{}

Cache is a naive cache that does not prevent multiple clients from filling the cache at the same time.

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, cmdable SimpleCmdable, item Item) ([]byte, error)

type Item

type Item struct {
	Key        string
	Expiration time.Duration
	Do         func() ([]byte, error)
}

type SimpleCmdable

type SimpleCmdable interface {
	SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
	Get(ctx context.Context, key string) *redis.StringCmd
}

SimpleCmdable is a simplified version of redis.Cmdable.

Jump to

Keyboard shortcuts

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