cache

package
v1.1.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Set 设置key value
	Set(key string, value string) error
	// 删除key
	Delete(key string) error
	// SetAndExpire  设置key value 并支持过期时间
	SetAndExpire(key string, value string, expire time.Duration) error

	// SetExpire  设置key的过期时间
	SetExpire(key string, expire time.Duration) error

	// 获取key对应的值
	Get(key string) (string, error)

	// LPUSH 向List添加元素
	LPUSH(key string, values ...interface{}) (int64, error)

	// LPop  获取List的第一个元素
	LPop(key string) (string, error)

	// SAdd 向Set添加元素
	SAdd(key string, members ...interface{}) error

	// SMembers 获取Set中的所有元素
	SMembers(key string) ([]string, error)
}

Cache 缓存接口

Jump to

Keyboard shortcuts

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