fakeredis

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Unlicense Imports: 9 Imported by: 0

README

Go Reference fakeredis

Finally a fake Redis implementation for Go.

This supports a bunch of basic commands (please contribute more!) and stores things in memory, with expiration, deletion and all that. All in a very naïve way, but it should work.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeRedis

type FakeRedis struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New() *FakeRedis

func (*FakeRedis) Close

func (f *FakeRedis) Close()

func (*FakeRedis) Del

func (f *FakeRedis) Del(keys ...string) *redis.IntCmd

func (*FakeRedis) Expire

func (f *FakeRedis) Expire(key string, expiration time.Duration) *redis.StatusCmd

func (*FakeRedis) Get

func (f *FakeRedis) Get(key string) *redis.StringCmd

func (*FakeRedis) HDel

func (f *FakeRedis) HDel(key string, fields ...string) *redis.IntCmd

func (*FakeRedis) HGet

func (f *FakeRedis) HGet(key string, field string) *redis.StringCmd

func (*FakeRedis) HGetAll

func (f *FakeRedis) HGetAll(key string) *redis.MapStringStringCmd

func (*FakeRedis) HSet

func (f *FakeRedis) HSet(key string, values ...any) *redis.IntCmd

func (*FakeRedis) Incr

func (f *FakeRedis) Incr(key string) *redis.IntCmd

func (*FakeRedis) LPush

func (f *FakeRedis) LPush(key string, values ...any) *redis.IntCmd

func (*FakeRedis) Ping

func (f *FakeRedis) Ping() *redis.StatusCmd

func (*FakeRedis) RPop

func (f *FakeRedis) RPop(key string) *redis.StringCmd

func (*FakeRedis) Set

func (f *FakeRedis) Set(key string, value any, expiration time.Duration) *redis.StatusCmd

func (*FakeRedis) SetNX

func (f *FakeRedis) SetNX(key string, value any, expiration time.Duration) *redis.BoolCmd

func (*FakeRedis) ZAdd added in v0.0.2

func (f *FakeRedis) ZAdd(key string, values ...redis.Z) *redis.IntCmd

func (*FakeRedis) ZAddNX added in v0.0.2

func (f *FakeRedis) ZAddNX(key string, values ...redis.Z) *redis.IntCmd

func (*FakeRedis) ZCard added in v0.0.2

func (f *FakeRedis) ZCard(key string) *redis.IntCmd

func (*FakeRedis) ZRangeByScore added in v0.0.2

func (f *FakeRedis) ZRangeByScore(key string, opt *redis.ZRangeBy) *redis.StringSliceCmd

func (*FakeRedis) ZRem added in v0.0.2

func (f *FakeRedis) ZRem(key string, members ...string) *redis.IntCmd

func (*FakeRedis) ZScore added in v0.0.2

func (f *FakeRedis) ZScore(key string, member string) *redis.IntCmd

Jump to

Keyboard shortcuts

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