remote

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 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 GoRedisV8Adaptor

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

func (*GoRedisV8Adaptor) Del

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

func (*GoRedisV8Adaptor) Get

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

func (*GoRedisV8Adaptor) MGet

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

func (*GoRedisV8Adaptor) MSet

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

func (*GoRedisV8Adaptor) Nil

func (r *GoRedisV8Adaptor) Nil() error

func (*GoRedisV8Adaptor) SetEX

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

func (*GoRedisV8Adaptor) SetNX

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

func (*GoRedisV8Adaptor) SetXX

func (r *GoRedisV8Adaptor) 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 NewGoRedisV8Adaptor

func NewGoRedisV8Adaptor(client redis.Cmdable) Remote

NewGoRedisV8Adaptor is

Jump to

Keyboard shortcuts

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