Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdapterCache Interface 为什么设计的接口这么少呢? #824

Open
zxiubo opened this issue Nov 29, 2024 · 1 comment
Open

AdapterCache Interface 为什么设计的接口这么少呢? #824

zxiubo opened this issue Nov 29, 2024 · 1 comment

Comments

@zxiubo
Copy link

zxiubo commented Nov 29, 2024

type AdapterCache interface {
	String() string
	Get(key string) (string, error)
	Set(key string, val interface{}, expire int) error
	Del(key string) error
	HashGet(hk, key string) (string, error)
	HashDel(hk, key string) error
	Increase(key string) error
	Decrease(key string) error
	Expire(key string, dur time.Duration) error
}

实现了 HashGet(hk, key string) (string, error) 方法,但是 hset 这类方法都没有实现?
请问这么设计的原因是什么呢?redis原生的client也拿不到...

@zxiubo
Copy link
Author

zxiubo commented Nov 29, 2024

发现可以这么写?

config.GetRedisClient().HSet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant