redis

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Proto = "redis"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

Redis cache implement

func (*Redis) Decrease

func (r *Redis) Decrease(ctx context.Context, key string) (int64, error)

func (*Redis) Del

func (r *Redis) Del(ctx context.Context, key string) error

Del delete key in redis

func (*Redis) Exists added in v0.1.1

func (r *Redis) Exists(ctx context.Context, key string) (bool, error)

Exists

func (*Redis) Expire

func (r *Redis) Expire(ctx context.Context, key string, expire int) error

Set ttl

func (*Redis) Get

func (r *Redis) Get(ctx context.Context, key string) (string, error)

Get from key

func (*Redis) GetImpl

func (r *Redis) GetImpl() interface{}

GetImpl 暴露原生client

func (*Redis) HashDel

func (r *Redis) HashDel(ctx context.Context, hk, key string) error

HashDel delete key in specify redis's hashtable

func (*Redis) HashExists added in v0.1.28

func (r *Redis) HashExists(ctx context.Context, hk, key string) (bool, error)

func (*Redis) HashGet

func (r *Redis) HashGet(ctx context.Context, hk, key string) (string, error)

HashGet from key

func (*Redis) HashMGet added in v0.1.28

func (r *Redis) HashMGet(ctx context.Context, hk string, key ...string) (map[string]interface{}, error)

func (*Redis) HashSet

func (r *Redis) HashSet(ctx context.Context, hk, key string, val string) (bool, error)

HashSet from key

func (*Redis) HashSetAll added in v0.1.28

func (r *Redis) HashSetAll(ctx context.Context, hk string, val map[string]interface{}) (bool, error)

func (*Redis) Increase

func (r *Redis) Increase(ctx context.Context, key string) (int64, error)

Increase

func (*Redis) Name

func (r *Redis) Name() string

func (*Redis) Set

func (r *Redis) Set(ctx context.Context, key string, val interface{}, expire int) error

Set value with key and expire time

Jump to

Keyboard shortcuts

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