gredis

package
v2.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gredis

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

Gredis cache implement

func NewGredis

func NewGredis(client *gredis.Redis) (*Gredis, error)

NewGredis redis模式

func (*Gredis) Decrease

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

func (*Gredis) Del

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

Del delete key in redis

func (*Gredis) Expire

func (r *Gredis) Expire(ctx context.Context, key string, dur time.Duration) error

Expire Set ttl

func (*Gredis) Get

func (r *Gredis) Get(ctx context.Context, key string) (*gvar.Var, error)

Get from key

func (*Gredis) GetClient

func (r *Gredis) GetClient() *gredis.Redis

GetClient 暴露原生client

func (*Gredis) HashDel

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

HashDel delete key in specify redis's hashtable

func (*Gredis) HashGet

func (r *Gredis) HashGet(ctx context.Context, hk, key string) (*gvar.Var, error)

HashGet from key

func (*Gredis) Increase

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

Increase get Increase

func (*Gredis) Set

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

Set value with key and expire time

func (*Gredis) String

func (*Gredis) String() string

Jump to

Keyboard shortcuts

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