Documentation
¶
Index ¶
- Variables
- func Get[T any](ctx context.Context, client *redis.Client, key string) (T, error)
- func GetOrCreate[T any](ctx context.Context, rc *Client, key string, ...) (T, error)
- func Release(ctx context.Context, lock RemoteLock)
- func Set[T any](ctx context.Context, client *redis.Client, key string, value T, ...) error
- type Client
- type Options
- type RemoteLock
Constants ¶
This section is empty.
Variables ¶
View Source
var Nil = redis.Nil
Nil is the error value in case the specified key does not exist
Functions ¶
func GetOrCreate ¶
func GetOrCreate[T any](ctx context.Context, rc *Client, key string, valueFactory func(*Options) (T, error)) (T, error)
GetOrCreate the cache entry
func Release ¶
func Release(ctx context.Context, lock RemoteLock)
Release the lock with logging the error occuring
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client contains the client and locker
Click to show internal directories.
Click to hide internal directories.