store

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore() *MemoryStore

func (*MemoryStore) Delete

func (s *MemoryStore) Delete(ctx context.Context, key string) error

func (*MemoryStore) Get

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

func (*MemoryStore) Set

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

type PrefixedStore

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

func NewPrefixedStore

func NewPrefixedStore(store Store, prefix string) *PrefixedStore

func (*PrefixedStore) Delete

func (s *PrefixedStore) Delete(ctx context.Context, key string) error

func (*PrefixedStore) Get

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

func (*PrefixedStore) Set

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

type RedisStore

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

func NewRedisStore

func NewRedisStore(client redis.Cmdable) *RedisStore

func (*RedisStore) Delete

func (s *RedisStore) Delete(ctx context.Context, key string) error

func (*RedisStore) Get

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

func (*RedisStore) Set

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

type Store

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

Jump to

Keyboard shortcuts

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