Documentation
¶
Index ¶
- func CreateTestRedisClient(t *testing.T, opts ...RedisTestOption) *redis.Client
- type RedisTestOption
- type UnitTestLogger
- func (l *UnitTestLogger) Debug(msg string, fields map[string]interface{})
- func (l *UnitTestLogger) Error(msg string, fields map[string]interface{})
- func (l *UnitTestLogger) Info(msg string, fields map[string]interface{})
- func (l *UnitTestLogger) WithSpanContext(spanContext adapter.SpanContext) adapter.Logger
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
Click to show internal directories.
Click to hide internal directories.