prowlredis

package
v0.0.0-...-6d375a0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package prowlredis is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ClientInterface
}

Client represents the Redis client.

type ClientInterface

type ClientInterface interface {
	Ping(ctx context.Context) error
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
	SAdd(ctx context.Context, key string, members ...interface{}) error
	Del(ctx context.Context, keys ...string) error
	SMembers(ctx context.Context, key string) ([]string, error)
	SIsMember(ctx context.Context, key string, member interface{}) (bool, error)
	Options() *Options
}

ClientInterface represents the interface for interacting with the Redis datastore.

func NewClient

func NewClient(ctx context.Context, cfg *Options) (ClientInterface, error)

NewClient creates a new Redis client.

type ClientRedis

type ClientRedis struct {
	*redis.Client
}

ClientRedis is a wrapper around the go-redis Client that implements the ClientInterface.

func (*ClientRedis) Close

func (c *ClientRedis) Close() error

func (*ClientRedis) Del

func (c *ClientRedis) Del(ctx context.Context, keys ...string) error

func (*ClientRedis) Options

func (c *ClientRedis) Options() *Options

func (*ClientRedis) Ping

func (c *ClientRedis) Ping(ctx context.Context) error

func (*ClientRedis) SAdd

func (c *ClientRedis) SAdd(ctx context.Context, key string, members ...interface{}) error

func (*ClientRedis) SIsMember

func (c *ClientRedis) SIsMember(ctx context.Context, key string, member interface{}) (bool, error)

func (*ClientRedis) SMembers

func (c *ClientRedis) SMembers(ctx context.Context, key string) ([]string, error)

func (*ClientRedis) Set

func (c *ClientRedis) Set(_ context.Context, _ string, _ interface{}, _ time.Duration) error

Set implements ClientInterface. Subtle: this method shadows the method (*Client).Set of ClientRedis.Client.

type MockClientInterface

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

MockClientInterface is a mock of ClientInterface interface.

func NewMockClientInterface

func NewMockClientInterface(ctrl *gomock.Controller) *MockClientInterface

NewMockClientInterface creates a new mock instance.

func (*MockClientInterface) Del

func (m *MockClientInterface) Del(ctx context.Context, keys ...string) error

Del mocks base method.

func (*MockClientInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClientInterface) Options

func (m *MockClientInterface) Options() *Options

Options mocks base method.

func (*MockClientInterface) Ping

Ping mocks base method.

func (*MockClientInterface) SAdd

func (m *MockClientInterface) SAdd(ctx context.Context, key string, members ...interface{}) error

SAdd mocks base method.

func (*MockClientInterface) SIsMember

func (m *MockClientInterface) SIsMember(ctx context.Context, key string, member interface{}) (bool, error)

SIsMember mocks base method.

func (*MockClientInterface) SMembers

func (m *MockClientInterface) SMembers(ctx context.Context, key string) ([]string, error)

SMembers mocks base method.

func (*MockClientInterface) Set

func (m *MockClientInterface) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error

Set implements ClientInterface.

type MockClientInterfaceMockRecorder

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

MockClientInterfaceMockRecorder is the mock recorder for MockClientInterface.

func (*MockClientInterfaceMockRecorder) Del

func (mr *MockClientInterfaceMockRecorder) Del(ctx interface{}, keys ...interface{}) *gomock.Call

Del indicates an expected call of Del.

func (*MockClientInterfaceMockRecorder) Options

Options indicates an expected call of Options.

func (*MockClientInterfaceMockRecorder) Ping

func (mr *MockClientInterfaceMockRecorder) Ping(ctx interface{}) *gomock.Call

Ping indicates an expected call of Ping.

func (*MockClientInterfaceMockRecorder) SAdd

func (mr *MockClientInterfaceMockRecorder) SAdd(ctx, key interface{}, members ...interface{}) *gomock.Call

SAdd indicates an expected call of SAdd.

func (*MockClientInterfaceMockRecorder) SIsMember

func (mr *MockClientInterfaceMockRecorder) SIsMember(ctx, key, member interface{}) *gomock.Call

SIsMember indicates an expected call of SIsMember.

func (*MockClientInterfaceMockRecorder) SMembers

func (mr *MockClientInterfaceMockRecorder) SMembers(ctx, key interface{}) *gomock.Call

SMembers indicates an expected call of SMembers.

type Options

type Options struct {
	Addr     string
	Password string
	DB       int
}

Options represents the options for a Redis client.

Jump to

Keyboard shortcuts

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