testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestRedisClient

func CreateTestRedisClient(
	t *testing.T,
	opts ...RedisTestOption,
) *redis.Client

CreateTestRedisClient creates a test Redis client. The client will connect to Redis, verify connectivity, and flush the dedicated test DB. In a real test environment, you might use testcontainers or a mock.

Types

type RedisTestOption

type RedisTestOption func(*redisTestOptions)

func WithRedisDB

func WithRedisDB(db int) RedisTestOption

type UnitTestLogger

type UnitTestLogger struct{}

func CreateUnitTestLogger

func CreateUnitTestLogger(t *testing.T) *UnitTestLogger

func (*UnitTestLogger) Debug

func (l *UnitTestLogger) Debug(msg string, fields map[string]interface{})

func (*UnitTestLogger) Error

func (l *UnitTestLogger) Error(msg string, fields map[string]interface{})

func (*UnitTestLogger) Info

func (l *UnitTestLogger) Info(msg string, fields map[string]interface{})

func (*UnitTestLogger) WithSpanContext

func (l *UnitTestLogger) WithSpanContext(spanContext adapter.SpanContext) adapter.Logger

Jump to

Keyboard shortcuts

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