Documentation
¶
Index ¶
- func CleanupKeys(ctx context.Context, client *redis.Client, namespace string) error
- func NewRedisClient() *redis.Client
- func PendingCount(ctx context.Context, client *redis.Client, stream, group string) (int64, error)
- func UniqueNamespace(t *testing.T, client *redis.Client) string
- func WaitFor(t *testing.T, condition func() bool, timeout time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupKeys ¶
CleanupKeys deletes all Redis keys matching "{namespace}:*" using SCAN + DEL.
func NewRedisClient ¶
NewRedisClient creates a Redis client for testing. Reads REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_USE_TLS env vars. Falls back to REDIS_URL for backward compatibility. Defaults to localhost:6379 without password or TLS.
func PendingCount ¶
PendingCount returns the number of pending messages for a stream+group.
func UniqueNamespace ¶
UniqueNamespace returns a test-scoped namespace like "test-TestName-1707000000-abc123". Registers a cleanup function to delete all keys with this prefix.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.