testutil

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestRedisClient

func NewTestRedisClient() (*redis.Client, *rediskittestutil.MockRedis)

NewTestRedisClient creates an in-memory Redis client for testing.

It uses miniredis, which implements real Redis semantics (including Lua EVAL, SET NX, and WATCH/MULTI) so tests exercise the same atomic code paths as production. The redis-kit MockRedis only understood a few hardcoded Lua scripts and could not validate the distributed-lock / swap-active / atomic idempotency invariants introduced in the security hardening work.

The second return value is retained for source compatibility with existing callers that expect a *MockRedis; it is nil because miniredis is used instead. Callers only ever used the *redis.Client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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