Documentation
¶
Index ¶
- Variables
- func Close() error
- func DeleteAfterScanExecuteInt(ctx context.Context, pattern string, f func(key string, value int) error) error
- func Incr(ctx context.Context, key string) (int64, error)
- func InitConnection(opts ...initConnOpt) error
- func Keys(ctx context.Context, pattern string) ([]string, error)
- func ScanExecute[T any](ctx context.Context, pattern string, f func(key string, value T) error) error
- func ToStatus(err error) *status.Status
- func WithAddr(addr string) initConnOpt
- func WithDb(db int) initConnOpt
- func WithPassword(password string) initConnOpt
- func WithUsername(username string) initConnOpt
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DeleteAfterScanExecuteInt ¶
func DeleteAfterScanExecuteInt(ctx context.Context, pattern string, f func(key string, value int) error) error
ScanExecuteInt iterates through keys in the cache matching a given pattern and executes a function for each key whose value can be parsed as an integer. It only considers keys of type 'string'. If the pattern is an empty string, it defaults to "*" to scan all keys.
func InitConnection ¶
func InitConnection(opts ...initConnOpt) error
func ScanExecute ¶
func ScanExecute[T any](ctx context.Context, pattern string, f func(key string, value T) error) error
ScanExecute iterates through keys in the cache matching a given pattern and executes a function for each key that can be successfully deserialized into the generic type T. It supports keys stored as JSON strings or Hashes. If the pattern is an empty string, it defaults to "*" to scan all keys.
func WithPassword ¶
func WithPassword(password string) initConnOpt
func WithUsername ¶
func WithUsername(username string) initConnOpt
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.