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

提交gredis命令接口 #1985

Merged
merged 5 commits into from Sep 22, 2022
Merged

提交gredis命令接口 #1985

merged 5 commits into from Sep 22, 2022

Conversation

FTLLOVE
Copy link
Contributor

@FTLLOVE FTLLOVE commented Jul 8, 2022

No description provided.

@gqcn
Copy link
Member

gqcn commented Jul 11, 2022

@FTLLOVE

  1. 这个接口需要简化一下,常用命令用不了这么多。
  2. 需要提供现在已有的Do接口方法,以便开发者使用除了接口方法之外的其他命令。
  3. 这个接口需要做一下分类,例如:
type Commander interface{
    KV() KV
    System() System
    // ...
}
type KV interface{
    Get(ctx context.Context, key string) (value string, err error)
    Set(ctx context.Context, key, value string) error
    // ...
}
type System interface{
    Flush(ctx context.Context) error
    // ...
}
  1. 这个接口中部分方法不够抽象,存在第三方结构的引用,例如:
XRange(ctx context.Context, stream, start, stop string) ([]redis.XMessage, error)
XRangeN(ctx context.Context, stream, start, stop string, count int64) ([]redis.XMessage, error)
XRevRange(ctx context.Context, stream, start, stop string) ([]redis.XMessage, error)
XRevRangeN(ctx context.Context, stream, start, stop string, count int64) ([]redis.XMessage, error)
XReadStreams(ctx context.Context, streams ...string) ([]redis.XStream, error)

建议这部分方法要么做一下抽象,要么去掉让开发者通过Do方法来调用。

@gqcn gqcn added the wip label Jul 11, 2022
@lierbai
Copy link

lierbai commented Aug 12, 2022

提个小建议,不建议提供Keys接口. O(n)

@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2022

Codecov Report

Base: 76.47% // Head: 76.47% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (6db2a1a) compared to base (2b4598f).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1985   +/-   ##
=======================================
  Coverage   76.47%   76.47%           
=======================================
  Files         517      517           
  Lines       46869    46869           
=======================================
+ Hits        35844    35845    +1     
  Misses       9044     9044           
+ Partials     1981     1980    -1     
Flag Coverage Δ
go-1.15-386 76.38% <ø> (ø)
go-1.15-amd64 76.36% <ø> (-0.03%) ⬇️
go-1.16-386 76.39% <ø> (+0.01%) ⬆️
go-1.16-amd64 76.40% <ø> (+0.03%) ⬆️
go-1.17-386 76.42% <ø> (-0.02%) ⬇️
go-1.17-amd64 76.41% <ø> (-0.02%) ⬇️
go-1.18-386 76.39% <ø> (+0.01%) ⬆️
go-1.18-amd64 76.41% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
os/gspath/gspath_cache.go 87.71% <0.00%> (-7.02%) ⬇️
os/gfpool/gfpool_file.go 68.57% <0.00%> (+2.85%) ⬆️
os/gcache/gcache_adapter_memory_lru.go 97.82% <0.00%> (+8.69%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@FTLLOVE
Copy link
Contributor Author

FTLLOVE commented Aug 14, 2022

_ No description provided. _

@gqcn 强哥,看下我重新提交的接口

@gqcn gqcn changed the base branch from master to feature/v2.2.0-gredis September 22, 2022 12:16
@gqcn gqcn merged commit de9ba2c into gogf:feature/v2.2.0-gredis Sep 22, 2022
@FTLLOVE FTLLOVE deleted the feature/redis branch September 22, 2022 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants