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

添加根据key删除健值对的接口 #24

Open
longyue0521 opened this issue Oct 9, 2023 · 3 comments
Open

添加根据key删除健值对的接口 #24

longyue0521 opened this issue Oct 9, 2023 · 3 comments

Comments

@longyue0521
Copy link
Contributor

longyue0521 commented Oct 9, 2023

仅限中文

使用场景

当前ecache.Cache接口中只有Set/Get接口, 在 #23 中提到需要设置永不过期的key,然后根据业务场景在需要的时候删除key,故需要添加Delete接口

行业分析

如果你知道有框架提供了类似功能,可以在这里描述,并且给出文档或者例子

方案一:

// Delete 删除一个或多个key, 当key不存在的时候,记入返回个数但不返回错误
func Delete(ctx context.Context, key ...string) (int64, error)

方案二:

// Delete 删除key,当key不存在的时候,不返回错误
func Delete(ctx context.Context, key string) error

可行方案

如果你有设计思路或者解决方案,请在这里提供。你可以提供多个方案,并且给出自己的选择

其它

任何你觉得有利于解决问题的补充说明

你使用的是 ecache 哪个版本?

你设置的的 Go 环境?

上传 go env 的结果

@flycash
Copy link
Contributor

flycash commented Oct 10, 2023

使用方案一

@flycash
Copy link
Contributor

flycash commented Oct 10, 2023

这样我就不需要再设计批量接口了

@longyue0521
Copy link
Contributor Author

使用方案一
好的

这样我就不需要再设计批量接口了

PR已提交 #25

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

2 participants