remote

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: BSD-2-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoRedisV9Adapter added in v1.1.6

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

func (*GoRedisV9Adapter) Del added in v1.1.6

func (r *GoRedisV9Adapter) Del(ctx context.Context, key string) (val int64, err error)

func (*GoRedisV9Adapter) Get added in v1.1.6

func (r *GoRedisV9Adapter) Get(ctx context.Context, key string) (val string, err error)

func (*GoRedisV9Adapter) MGet added in v1.1.6

func (r *GoRedisV9Adapter) MGet(ctx context.Context, keys ...string) (map[string]any, error)

func (*GoRedisV9Adapter) MSet added in v1.1.6

func (r *GoRedisV9Adapter) MSet(ctx context.Context, value map[string]any, expire time.Duration) error

func (*GoRedisV9Adapter) Nil added in v1.1.6

func (r *GoRedisV9Adapter) Nil() error

func (*GoRedisV9Adapter) SetEX added in v1.1.6

func (r *GoRedisV9Adapter) SetEX(ctx context.Context, key string, value any, expire time.Duration) error

func (*GoRedisV9Adapter) SetNX added in v1.1.6

func (r *GoRedisV9Adapter) SetNX(ctx context.Context, key string, value any, expire time.Duration) (val bool, err error)

func (*GoRedisV9Adapter) SetXX added in v1.1.6

func (r *GoRedisV9Adapter) SetXX(ctx context.Context, key string, value any, expire time.Duration) (val bool, err error)

type Remote

type Remote interface {
	// SetEX sets the expiration value for a key.
	SetEX(ctx context.Context, key string, value any, expire time.Duration) error

	// SetNX sets the value of a key if it does not already exist.
	SetNX(ctx context.Context, key string, value any, expire time.Duration) (val bool, err error)

	// SetXX sets the value of a key if it already exists.
	SetXX(ctx context.Context, key string, value any, expire time.Duration) (val bool, err error)

	// Get retrieves the value of a key. It returns errNotFound (e.g., redis.Nil) when the key does not exist.
	Get(ctx context.Context, key string) (val string, err error)

	// Del deletes the cached value associated with a key.
	Del(ctx context.Context, key string) (val int64, err error)

	// MGet retrieves the values of multiple keys.
	MGet(ctx context.Context, keys ...string) (map[string]any, error)

	// MSet sets multiple key-value pairs in the cache.
	MSet(ctx context.Context, value map[string]any, expire time.Duration) error

	// Nil returns an error indicating that the key does not exist.
	Nil() error
}

func NewGoRedisV9Adapter added in v1.1.6

func NewGoRedisV9Adapter(client redis.Cmdable) Remote

NewGoRedisV9Adapter is

Jump to

Keyboard shortcuts

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