redisstore

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Get(ctx context.Context, key string) (string, error)
	Set(ctx context.Context, key string, value string, ttl time.Duration) error
}

Client is a minimal interface for Redis operations.

func NewGoRedisAdapter

func NewGoRedisAdapter(rdb *redis.Client) Client

type MockClient

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

func NewMockClient

func NewMockClient() *MockClient

func (*MockClient) Get

func (m *MockClient) Get(ctx context.Context, key string) (string, error)

func (*MockClient) Set

func (m *MockClient) Set(ctx context.Context, key string, value string, ttl time.Duration) error

type Store

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

func New

func New(client Client) *Store

func (*Store) Get

func (s *Store) Get(ctx context.Context, key string) (string, error)

Get returns the string value for the given key.

func (*Store) Set

func (s *Store) Set(ctx context.Context, key string, value string, ttl time.Duration) error

Set stores a string value with a TTL.

Jump to

Keyboard shortcuts

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