testutil

package
v1.8.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockRedis

type MockRedis struct {
	// contains filtered or unexported fields
}

MockRedis is a simple in-memory Redis mock for testing

func NewMockRedis

func NewMockRedis() *MockRedis

NewMockRedis creates a new mock Redis instance

func NewMockRedisClient

func NewMockRedisClient() (*redis.Client, *MockRedis)

NewMockRedisClient creates a Redis client that uses the mock

func (*MockRedis) Dialer added in v1.0.1

func (m *MockRedis) Dialer() func(context.Context, string, string) (net.Conn, error)

Dialer returns a function that can be used as client.Config.Dialer for testing.

func (*MockRedis) SetShouldFail

func (m *MockRedis) SetShouldFail(fail bool)

SetShouldFail sets whether operations should fail

Jump to

Keyboard shortcuts

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