data

package
v0.0.0-...-24cc725 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound = errors.New("key not found")
)

Functions

This section is empty.

Types

type DB

type DB interface {
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (err error)
	Get(ctx context.Context, key string, value interface{}) error
}

type MemoryStore

type MemoryStore struct {
	Data map[string][]byte
}

func (*MemoryStore) Get

func (s *MemoryStore) Get(ctx context.Context, key string, value interface{}) error

func (*MemoryStore) Set

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

type RedisStore

type RedisStore struct {
	Client *redis.Client
}

func (*RedisStore) Get

func (s *RedisStore) Get(ctx context.Context, key string, value interface{}) error

func (*RedisStore) Set

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

Jump to

Keyboard shortcuts

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