redis

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) cache.Store

Types

type Option

type Option func(*options)

func Prefix

func Prefix(prefix string) Option

func Redis

func Redis(redis redis.Cmdable) Option

func Serializer

func Serializer(serializer serializer.Serializable) Option

type Store

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

func (*Store) Add

func (s *Store) Add(ctx context.Context, key string, value interface{}, ttl time.Duration) (bool, error)

func (*Store) Decrement

func (s *Store) Decrement(ctx context.Context, key string, value int) (int, error)

func (*Store) Flush

func (s *Store) Flush(ctx context.Context) error

func (*Store) Forever

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

func (*Store) Forget

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

func (*Store) Get

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

func (*Store) GetPrefix

func (s *Store) GetPrefix() string

func (*Store) Has

func (s *Store) Has(ctx context.Context, key string) bool

func (*Store) Increment

func (s *Store) Increment(ctx context.Context, key string, value int) (int, error)

func (*Store) Put

func (s *Store) Put(ctx context.Context, key string, value interface{}, ttl time.Duration) error

Jump to

Keyboard shortcuts

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