rueidis

package
v2.3.8 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RueidisType represents the storage type as a string value
	RueidisType = "rueidis"
	// RueidisTagPattern represents the tag pattern to be used as a key in specified storage
	RueidisTagPattern = "gocache_tag_%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RueidisStore

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

RueidisStore is a store for Redis

func NewRueidis

func NewRueidis(client rueidis.Client, options ...lib_store.Option) *RueidisStore

NewRueidis creates a new store to Redis instance(s)

func (*RueidisStore) Clear

func (s *RueidisStore) Clear(ctx context.Context) error

Clear resets all data in the store

func (*RueidisStore) Delete

func (s *RueidisStore) Delete(ctx context.Context, key any) error

Delete removes data from Redis for given key identifier

func (*RueidisStore) Get

func (s *RueidisStore) Get(ctx context.Context, key any) (any, error)

Get returns data stored from a given key

func (*RueidisStore) GetType

func (s *RueidisStore) GetType() string

GetType returns the store type

func (*RueidisStore) GetWithTTL

func (s *RueidisStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)

GetWithTTL returns data stored from a given key and its corresponding TTL

func (*RueidisStore) Invalidate

func (s *RueidisStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error

Invalidate invalidates some cache data in Redis for given options

func (*RueidisStore) Set

func (s *RueidisStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error

Set defines data in Redis for given key identifier

Jump to

Keyboard shortcuts

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