mock

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

func NewMockRedis

func NewMockRedis(ctx context.Context) *Redis

NewMockRedis 创建一个 Redis 实例

func (*Redis) Get

func (m *Redis) Get(key string) (string, error)

Get 模拟 Get 方法

func (*Redis) Hdel

func (m *Redis) Hdel(key string, fields ...string) (bool, error)

func (*Redis) Hset

func (m *Redis) Hset(key, field, value string) error

func (*Redis) Set

func (m *Redis) Set(key, value string) error

func (*Redis) Setex

func (m *Redis) Setex(key, value string, seconds int) error

Setex 模拟 Setex 方法

func (*Redis) SetnxEx

func (m *Redis) SetnxEx(key, value string, seconds int) (bool, error)

Jump to

Keyboard shortcuts

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