redis

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultShutdownTimeout = 10 * time.Second
	DefaultShutdownHandler = true
)
View Source
const Nil = redis.Nil

Nil reply returned by Redis when key does not exist.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager added in v0.4.0

type Manager interface {
	Client() *redis.Client
	SetClient(client *redis.Client) Manager
	SetTelemetryManager(telemetry telemetry.Manager) error
	GetShutdownTimeout() time.Duration
	GetShutdownHandler() bool
	Shutdown(ctx context.Context, code int) error
}

func New

func New(opts ...Option) Manager

type MockManager added in v0.11.0

type MockManager struct {
	mock.Mock
}

MockManager is an autogenerated mock type for the Manager type

func NewMockManager added in v0.11.0

func NewMockManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockManager

NewMockManager creates a new instance of MockManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockManager) Client added in v0.11.0

func (_mock *MockManager) Client() *redis.Client

Client provides a mock function for the type MockManager

func (*MockManager) EXPECT added in v0.11.0

func (_m *MockManager) EXPECT() *MockManager_Expecter

func (*MockManager) GetShutdownHandler added in v0.11.0

func (_mock *MockManager) GetShutdownHandler() bool

GetShutdownHandler provides a mock function for the type MockManager

func (*MockManager) GetShutdownTimeout added in v0.11.0

func (_mock *MockManager) GetShutdownTimeout() time.Duration

GetShutdownTimeout provides a mock function for the type MockManager

func (*MockManager) SetClient added in v0.11.0

func (_mock *MockManager) SetClient(client *redis.Client) Manager

SetClient provides a mock function for the type MockManager

func (*MockManager) SetTelemetryManager added in v0.11.0

func (_mock *MockManager) SetTelemetryManager(telemetry1 telemetry.Manager) error

SetTelemetryManager provides a mock function for the type MockManager

func (*MockManager) Shutdown added in v0.11.0

func (_mock *MockManager) Shutdown(ctx context.Context, code int) error

Shutdown provides a mock function for the type MockManager

type MockManager_Client_Call added in v0.11.0

type MockManager_Client_Call struct {
	*mock.Call
}

MockManager_Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Client'

func (*MockManager_Client_Call) Return added in v0.11.0

func (*MockManager_Client_Call) Run added in v0.11.0

func (_c *MockManager_Client_Call) Run(run func()) *MockManager_Client_Call

func (*MockManager_Client_Call) RunAndReturn added in v0.11.0

func (_c *MockManager_Client_Call) RunAndReturn(run func() *redis.Client) *MockManager_Client_Call

type MockManager_Expecter added in v0.11.0

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

func (*MockManager_Expecter) Client added in v0.11.0

Client is a helper method to define mock.On call

func (*MockManager_Expecter) GetShutdownHandler added in v0.11.0

GetShutdownHandler is a helper method to define mock.On call

func (*MockManager_Expecter) GetShutdownTimeout added in v0.11.0

GetShutdownTimeout is a helper method to define mock.On call

func (*MockManager_Expecter) SetClient added in v0.11.0

func (_e *MockManager_Expecter) SetClient(client interface{}) *MockManager_SetClient_Call

SetClient is a helper method to define mock.On call

  • client *redis.Client

func (*MockManager_Expecter) SetTelemetryManager added in v0.11.0

func (_e *MockManager_Expecter) SetTelemetryManager(telemetry1 interface{}) *MockManager_SetTelemetryManager_Call

SetTelemetryManager is a helper method to define mock.On call

  • telemetry1 telemetry.Manager

func (*MockManager_Expecter) Shutdown added in v0.11.0

func (_e *MockManager_Expecter) Shutdown(ctx interface{}, code interface{}) *MockManager_Shutdown_Call

Shutdown is a helper method to define mock.On call

  • ctx context.Context
  • code int

type MockManager_GetShutdownHandler_Call added in v0.11.0

type MockManager_GetShutdownHandler_Call struct {
	*mock.Call
}

MockManager_GetShutdownHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetShutdownHandler'

func (*MockManager_GetShutdownHandler_Call) Return added in v0.11.0

func (*MockManager_GetShutdownHandler_Call) Run added in v0.11.0

func (*MockManager_GetShutdownHandler_Call) RunAndReturn added in v0.11.0

type MockManager_GetShutdownTimeout_Call added in v0.11.0

type MockManager_GetShutdownTimeout_Call struct {
	*mock.Call
}

MockManager_GetShutdownTimeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetShutdownTimeout'

func (*MockManager_GetShutdownTimeout_Call) Return added in v0.11.0

func (*MockManager_GetShutdownTimeout_Call) Run added in v0.11.0

func (*MockManager_GetShutdownTimeout_Call) RunAndReturn added in v0.11.0

type MockManager_SetClient_Call added in v0.11.0

type MockManager_SetClient_Call struct {
	*mock.Call
}

MockManager_SetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetClient'

func (*MockManager_SetClient_Call) Return added in v0.11.0

func (*MockManager_SetClient_Call) Run added in v0.11.0

func (*MockManager_SetClient_Call) RunAndReturn added in v0.11.0

func (_c *MockManager_SetClient_Call) RunAndReturn(run func(client *redis.Client) Manager) *MockManager_SetClient_Call

type MockManager_SetTelemetryManager_Call added in v0.11.0

type MockManager_SetTelemetryManager_Call struct {
	*mock.Call
}

MockManager_SetTelemetryManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTelemetryManager'

func (*MockManager_SetTelemetryManager_Call) Return added in v0.11.0

func (*MockManager_SetTelemetryManager_Call) Run added in v0.11.0

func (*MockManager_SetTelemetryManager_Call) RunAndReturn added in v0.11.0

type MockManager_Shutdown_Call added in v0.11.0

type MockManager_Shutdown_Call struct {
	*mock.Call
}

MockManager_Shutdown_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shutdown'

func (*MockManager_Shutdown_Call) Return added in v0.11.0

func (*MockManager_Shutdown_Call) Run added in v0.11.0

func (*MockManager_Shutdown_Call) RunAndReturn added in v0.11.0

func (_c *MockManager_Shutdown_Call) RunAndReturn(run func(ctx context.Context, code int) error) *MockManager_Shutdown_Call

type Option

type Option func(*r)

func WithClient

func WithClient(client *redis.Client) Option

func WithClientOptions

func WithClientOptions(opts ...client.Option) Option

func WithShutdownTimeout

func WithShutdownTimeout(timeout time.Duration) Option

func WithoutShutdownHandler

func WithoutShutdownHandler() Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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