-
Notifications
You must be signed in to change notification settings - Fork 70
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
docs: Document DragonflyDB support #1564
Conversation
WalkthroughThe pull request updates the Redis documentation by adding a section that details how to use DragonflyDB as a fully compatible alternative to Redis. Additionally, the comment for the Changes
Sequence Diagram(s)(No control flow changes to diagram.) Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (8)
dragonfly/dragonfly.go (2)
14-22
: Consider adding configuration validation.The
New
function accepts configuration but doesn't validate critical parameters. Consider adding validation for connection-related fields.func New(config ...Config) *Storage { + // Validate configuration + if cfg := configDefault(config...); cfg.Host != "" { + if cfg.Port <= 0 || cfg.Port > 65535 { + cfg.Port = ConfigDefault.Port + } + } - cfg := configDefault(config...) s := redisStore.New(cfg) return &Storage{ rstorage: s, } }
1-51
: Add package documentation.The package lacks documentation explaining its purpose, usage, and relationship with Dragonfly. Consider adding package-level documentation.
+// Package dragonfly provides a storage implementation for the Fiber web framework +// using Dragonfly (https://github.com/dragonflydb/dragonfly) as the backend. +// Dragonfly is a modern in-memory datastore, fully compatible with Redis and Memcached APIs. package dragonflydragonfly/config.go (2)
Line range hint
131-135
: Clarify URL documentation for Dragonfly.The URL field documentation mentions "Dragonfly URL" but the example shows a Redis URL format. This might be confusing for users.
- // URL standard format Dragonfly URL. If this is set all other config options, Host, Port, Username, Password, Database have no effect. + // URL in Redis-compatible format for Dragonfly connection. When set, this takes precedence over individual connection parameters + // (Host, Port, Username, Password, Database). // // Example: redis://<user>:<pass>@localhost:6379/<db> // Optional. Default is ""
102-126
: Enhance configDefault function robustness.The
configDefault
function could be more robust in handling edge cases and validating configuration.func configDefault(config ...Config) redis.Config { // Return default config if nothing provided if len(config) < 1 { return redis.ConfigDefault } // Override default config cfg := config[0] + // Validate and set URL configuration + if cfg.URL != "" { + return redis.Config{URL: cfg.URL} + } + // Set default values if cfg.Host == "" { cfg.Host = ConfigDefault.Host } if cfg.Port <= 0 { cfg.Port = ConfigDefault.Port } + // Ensure positive pool size + if cfg.PoolSize <= 0 { + cfg.PoolSize = ConfigDefault.PoolSize + }dragonfly/dragonfly_test.go (2)
66-88
: Improve expiration test reliability.The expiration test uses a hard-coded sleep duration which could be flaky. Consider making it more reliable.
func Test_Dragonfly_Expiration(t *testing.T) { var ( testStore = New(Config{ Reset: true, }) key = "john" val = []byte("doe") - exp = 1 * time.Second + exp = 100 * time.Millisecond ) err := testStore.Set(key, val, exp) require.NoError(t, err) - time.Sleep(1100 * time.Millisecond) + // Wait for slightly longer than expiration + time.Sleep(exp + 50*time.Millisecond)
429-475
: Enhance benchmark coverage.The benchmarks could be more comprehensive. Consider adding:
- Benchmarks with different payload sizes
- Concurrent operation benchmarks
- Benchmarks for different expiration settings
dragonfly/README.md (2)
50-51
: Fix grammatical issue in example introduction.The sentence structure is incorrect.
- You can use the one of the following options to create a Dragonfly Storage: + You can use one of the following options to create a Dragonfly Storage:🧰 Tools
🪛 LanguageTool
[misspelling] ~50-~50: Make sure that ‘the one of’ is correct and that ‘one’ is a pronoun. Possibly, the ‘the’ is unnecessary or ‘of’ is better expressed with a preposition such as ‘about’ or ‘in’.
Context: ...ber/storage/dragonfly" ``` You can use the one of the following options to create a Drago...(THE_ONE_OF_DT)
12-12
: Add more Dragonfly-specific information.The documentation could benefit from more Dragonfly-specific details, such as compatibility notes or specific features.
- A Dragonfly storage driver using [go-redis/redis](https://github.com/go-redis/redis). (Dragonfly is a redis-like database) + A storage driver for [Dragonfly](https://github.com/dragonflydb/dragonfly), a modern in-memory datastore that is fully compatible with Redis APIs. This implementation uses [go-redis/redis](https://github.com/go-redis/redis) client and supports all Redis-compatible features including: + + - Key-value storage with expiration + - Cluster mode + - Sentinel support + - TLS encryption + - Connection pooling
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
dragonfly/go.mod
is excluded by!**/*.mod
dragonfly/go.sum
is excluded by!**/*.sum
,!**/*.sum
📒 Files selected for processing (4)
dragonfly/README.md
(1 hunks)dragonfly/config.go
(1 hunks)dragonfly/dragonfly.go
(1 hunks)dragonfly/dragonfly_test.go
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
dragonfly/README.md
[style] ~6-~6: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 1134 characters long)
Context: ...ub/v/tag/gofiber/storage?filter=redis*)
![Security](https://img.shields.io/github...
(EN_EXCESSIVE_EXCLAMATION)
[misspelling] ~50-~50: Make sure that ‘the one of’ is correct and that ‘one’ is a pronoun. Possibly, the ‘the’ is unnecessary or ‘of’ is better expressed with a preposition such as ‘about’ or ‘in’.
Context: ...ber/storage/dragonfly" ``` You can use the one of the following options to create a Drago...
(THE_ONE_OF_DT)
🪛 markdownlint-cli2 (0.17.2)
dragonfly/README.md
14-14: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
57-57: Hard tabs
Column: 1
(MD010, no-hard-tabs)
58-58: Hard tabs
Column: 1
(MD010, no-hard-tabs)
59-59: Hard tabs
Column: 1
(MD010, no-hard-tabs)
60-60: Hard tabs
Column: 1
(MD010, no-hard-tabs)
61-61: Hard tabs
Column: 1
(MD010, no-hard-tabs)
62-62: Hard tabs
Column: 1
(MD010, no-hard-tabs)
63-63: Hard tabs
Column: 1
(MD010, no-hard-tabs)
64-64: Hard tabs
Column: 1
(MD010, no-hard-tabs)
69-69: Hard tabs
Column: 1
(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
81-81: Hard tabs
Column: 1
(MD010, no-hard-tabs)
82-82: Hard tabs
Column: 1
(MD010, no-hard-tabs)
85-85: Hard tabs
Column: 1
(MD010, no-hard-tabs)
86-86: Hard tabs
Column: 1
(MD010, no-hard-tabs)
87-87: Hard tabs
Column: 1
(MD010, no-hard-tabs)
90-90: Hard tabs
Column: 1
(MD010, no-hard-tabs)
90-90: Hard tabs
Column: 11
(MD010, no-hard-tabs)
91-91: Hard tabs
Column: 1
(MD010, no-hard-tabs)
91-91: Hard tabs
Column: 13
(MD010, no-hard-tabs)
92-92: Hard tabs
Column: 1
(MD010, no-hard-tabs)
92-92: Hard tabs
Column: 12
(MD010, no-hard-tabs)
98-98: Hard tabs
Column: 1
(MD010, no-hard-tabs)
99-99: Hard tabs
Column: 1
(MD010, no-hard-tabs)
106-106: Hard tabs
Column: 1
(MD010, no-hard-tabs)
107-107: Hard tabs
Column: 1
(MD010, no-hard-tabs)
108-108: Hard tabs
Column: 1
(MD010, no-hard-tabs)
109-109: Hard tabs
Column: 1
(MD010, no-hard-tabs)
111-111: Hard tabs
Column: 1
(MD010, no-hard-tabs)
112-112: Hard tabs
Column: 1
(MD010, no-hard-tabs)
113-113: Hard tabs
Column: 1
(MD010, no-hard-tabs)
114-114: Hard tabs
Column: 1
(MD010, no-hard-tabs)
116-116: Hard tabs
Column: 1
(MD010, no-hard-tabs)
117-117: Hard tabs
Column: 1
(MD010, no-hard-tabs)
118-118: Hard tabs
Column: 1
(MD010, no-hard-tabs)
119-119: Hard tabs
Column: 1
(MD010, no-hard-tabs)
121-121: Hard tabs
Column: 1
(MD010, no-hard-tabs)
122-122: Hard tabs
Column: 1
(MD010, no-hard-tabs)
123-123: Hard tabs
Column: 1
(MD010, no-hard-tabs)
124-124: Hard tabs
Column: 1
(MD010, no-hard-tabs)
126-126: Hard tabs
Column: 1
(MD010, no-hard-tabs)
127-127: Hard tabs
Column: 1
(MD010, no-hard-tabs)
128-128: Hard tabs
Column: 1
(MD010, no-hard-tabs)
129-129: Hard tabs
Column: 1
(MD010, no-hard-tabs)
131-131: Hard tabs
Column: 1
(MD010, no-hard-tabs)
132-132: Hard tabs
Column: 1
(MD010, no-hard-tabs)
133-133: Hard tabs
Column: 1
(MD010, no-hard-tabs)
134-134: Hard tabs
Column: 1
(MD010, no-hard-tabs)
135-135: Hard tabs
Column: 1
(MD010, no-hard-tabs)
137-137: Hard tabs
Column: 1
(MD010, no-hard-tabs)
138-138: Hard tabs
Column: 1
(MD010, no-hard-tabs)
139-139: Hard tabs
Column: 1
(MD010, no-hard-tabs)
140-140: Hard tabs
Column: 1
(MD010, no-hard-tabs)
142-142: Hard tabs
Column: 1
(MD010, no-hard-tabs)
143-143: Hard tabs
Column: 1
(MD010, no-hard-tabs)
144-144: Hard tabs
Column: 1
(MD010, no-hard-tabs)
145-145: Hard tabs
Column: 1
(MD010, no-hard-tabs)
147-147: Hard tabs
Column: 1
(MD010, no-hard-tabs)
148-148: Hard tabs
Column: 1
(MD010, no-hard-tabs)
149-149: Hard tabs
Column: 1
(MD010, no-hard-tabs)
150-150: Hard tabs
Column: 1
(MD010, no-hard-tabs)
152-152: Hard tabs
Column: 1
(MD010, no-hard-tabs)
153-153: Hard tabs
Column: 1
(MD010, no-hard-tabs)
154-154: Hard tabs
Column: 1
(MD010, no-hard-tabs)
155-155: Hard tabs
Column: 1
(MD010, no-hard-tabs)
157-157: Hard tabs
Column: 1
(MD010, no-hard-tabs)
158-158: Hard tabs
Column: 1
(MD010, no-hard-tabs)
159-159: Hard tabs
Column: 1
(MD010, no-hard-tabs)
160-160: Hard tabs
Column: 1
(MD010, no-hard-tabs)
162-162: Hard tabs
Column: 1
(MD010, no-hard-tabs)
163-163: Hard tabs
Column: 1
(MD010, no-hard-tabs)
164-164: Hard tabs
Column: 1
(MD010, no-hard-tabs)
165-165: Hard tabs
Column: 1
(MD010, no-hard-tabs)
167-167: Hard tabs
Column: 1
(MD010, no-hard-tabs)
168-168: Hard tabs
Column: 1
(MD010, no-hard-tabs)
169-169: Hard tabs
Column: 1
(MD010, no-hard-tabs)
170-170: Hard tabs
Column: 1
(MD010, no-hard-tabs)
172-172: Hard tabs
Column: 1
(MD010, no-hard-tabs)
173-173: Hard tabs
Column: 1
(MD010, no-hard-tabs)
174-174: Hard tabs
Column: 1
(MD010, no-hard-tabs)
175-175: Hard tabs
Column: 1
(MD010, no-hard-tabs)
182-182: Hard tabs
Column: 1
(MD010, no-hard-tabs)
183-183: Hard tabs
Column: 1
(MD010, no-hard-tabs)
184-184: Hard tabs
Column: 1
(MD010, no-hard-tabs)
185-185: Hard tabs
Column: 1
(MD010, no-hard-tabs)
186-186: Hard tabs
Column: 1
(MD010, no-hard-tabs)
187-187: Hard tabs
Column: 1
(MD010, no-hard-tabs)
188-188: Hard tabs
Column: 1
(MD010, no-hard-tabs)
189-189: Hard tabs
Column: 1
(MD010, no-hard-tabs)
190-190: Hard tabs
Column: 1
(MD010, no-hard-tabs)
191-191: Hard tabs
Column: 1
(MD010, no-hard-tabs)
192-192: Hard tabs
Column: 1
(MD010, no-hard-tabs)
193-193: Hard tabs
Column: 1
(MD010, no-hard-tabs)
194-194: Hard tabs
Column: 1
(MD010, no-hard-tabs)
195-195: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🔇 Additional comments (1)
dragonfly/dragonfly.go (1)
10-12
: LGTM! Clean struct design.The
Storage
struct provides a clean wrapper around the Redis storage implementation, which is appropriate since Dragonfly is Redis-compatible.
@SadikSunbul I dont think we need this driver. You can talk to DragonflyDB using our existing Redis and Rueidis drivers |
You're right that Dragonfly can be used with existing Redis and Rueidis drivers. Instead of adding a separate driver, I can update the documentation to explicitly mention that Fiber’s Redis storage is compatible with Dragonfly. This would help users understand that they can use Dragonfly without any additional integration. Let me know if that sounds good to you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
♻️ Duplicate comments (1)
dragonfly/README.md (1)
17-21
:⚠️ Potential issueFix documentation links.
The Table of Contents links incorrectly reference the dragonfly directory.
-[Signatures](../dragonfly/README.md#signatures) -[Installation](../dragonfly/README.md#installation) -[Examples](../dragonfly/README.md#examples) -[Config](../dragonfly/README.md#config) -[Default Config](../dragonfly/README.md#default-config) +[Signatures](#signatures) +[Installation](#installation) +[Examples](#examples) +[Config](#config) +[Default Config](#default-config)
🧹 Nitpick comments (2)
dragonfly/README.md (2)
50-51
: Fix grammatical error in the example introduction.The sentence structure is incorrect.
-You can use the one of the following options to create a Dragonfly Storage: +You can use one of the following options to create a Dragonfly Storage:🧰 Tools
🪛 LanguageTool
[misspelling] ~50-~50: Make sure that ‘the one of’ is correct and that ‘one’ is a pronoun. Possibly, the ‘the’ is unnecessary or ‘of’ is better expressed with a preposition such as ‘about’ or ‘in’.
Context: ...ber/storage/dragonfly" ``` You can use the one of the following options to create a Drago...(THE_ONE_OF_DT)
1-197
: Consider addressing the redundancy concern.Based on the PR objectives, user gaby raised a valid point about the necessity of a dedicated Dragonfly driver when the Redis driver might suffice. Consider adding a section explaining the benefits and differences of using this dedicated driver versus using the Redis driver.
🧰 Tools
🪛 LanguageTool
[style] ~6-~6: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 1134 characters long)
Context: ...ub/v/tag/gofiber/storage?filter=redis*)![]()
![Security](https://img.shields.io/github...
(EN_EXCESSIVE_EXCLAMATION)
[misspelling] ~50-~50: Make sure that ‘the one of’ is correct and that ‘one’ is a pronoun. Possibly, the ‘the’ is unnecessary or ‘of’ is better expressed with a preposition such as ‘about’ or ‘in’.
Context: ...ber/storage/dragonfly" ``` You can use the one of the following options to create a Drago...(THE_ONE_OF_DT)
🪛 markdownlint-cli2 (0.17.2)
14-14: Emphasis used instead of a heading
null(MD036, no-emphasis-as-heading)
57-57: Hard tabs
Column: 1(MD010, no-hard-tabs)
58-58: Hard tabs
Column: 1(MD010, no-hard-tabs)
59-59: Hard tabs
Column: 1(MD010, no-hard-tabs)
60-60: Hard tabs
Column: 1(MD010, no-hard-tabs)
61-61: Hard tabs
Column: 1(MD010, no-hard-tabs)
62-62: Hard tabs
Column: 1(MD010, no-hard-tabs)
63-63: Hard tabs
Column: 1(MD010, no-hard-tabs)
64-64: Hard tabs
Column: 1(MD010, no-hard-tabs)
69-69: Hard tabs
Column: 1(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1(MD010, no-hard-tabs)
81-81: Hard tabs
Column: 1(MD010, no-hard-tabs)
82-82: Hard tabs
Column: 1(MD010, no-hard-tabs)
85-85: Hard tabs
Column: 1(MD010, no-hard-tabs)
86-86: Hard tabs
Column: 1(MD010, no-hard-tabs)
87-87: Hard tabs
Column: 1(MD010, no-hard-tabs)
90-90: Hard tabs
Column: 1(MD010, no-hard-tabs)
90-90: Hard tabs
Column: 11(MD010, no-hard-tabs)
91-91: Hard tabs
Column: 1(MD010, no-hard-tabs)
91-91: Hard tabs
Column: 13(MD010, no-hard-tabs)
92-92: Hard tabs
Column: 1(MD010, no-hard-tabs)
92-92: Hard tabs
Column: 12(MD010, no-hard-tabs)
98-98: Hard tabs
Column: 1(MD010, no-hard-tabs)
99-99: Hard tabs
Column: 1(MD010, no-hard-tabs)
106-106: Hard tabs
Column: 1(MD010, no-hard-tabs)
107-107: Hard tabs
Column: 1(MD010, no-hard-tabs)
108-108: Hard tabs
Column: 1(MD010, no-hard-tabs)
109-109: Hard tabs
Column: 1(MD010, no-hard-tabs)
111-111: Hard tabs
Column: 1(MD010, no-hard-tabs)
112-112: Hard tabs
Column: 1(MD010, no-hard-tabs)
113-113: Hard tabs
Column: 1(MD010, no-hard-tabs)
114-114: Hard tabs
Column: 1(MD010, no-hard-tabs)
116-116: Hard tabs
Column: 1(MD010, no-hard-tabs)
117-117: Hard tabs
Column: 1(MD010, no-hard-tabs)
118-118: Hard tabs
Column: 1(MD010, no-hard-tabs)
119-119: Hard tabs
Column: 1(MD010, no-hard-tabs)
121-121: Hard tabs
Column: 1(MD010, no-hard-tabs)
122-122: Hard tabs
Column: 1(MD010, no-hard-tabs)
123-123: Hard tabs
Column: 1(MD010, no-hard-tabs)
124-124: Hard tabs
Column: 1(MD010, no-hard-tabs)
126-126: Hard tabs
Column: 1(MD010, no-hard-tabs)
127-127: Hard tabs
Column: 1(MD010, no-hard-tabs)
128-128: Hard tabs
Column: 1(MD010, no-hard-tabs)
129-129: Hard tabs
Column: 1(MD010, no-hard-tabs)
131-131: Hard tabs
Column: 1(MD010, no-hard-tabs)
132-132: Hard tabs
Column: 1(MD010, no-hard-tabs)
133-133: Hard tabs
Column: 1(MD010, no-hard-tabs)
134-134: Hard tabs
Column: 1(MD010, no-hard-tabs)
135-135: Hard tabs
Column: 1(MD010, no-hard-tabs)
137-137: Hard tabs
Column: 1(MD010, no-hard-tabs)
138-138: Hard tabs
Column: 1(MD010, no-hard-tabs)
139-139: Hard tabs
Column: 1(MD010, no-hard-tabs)
140-140: Hard tabs
Column: 1(MD010, no-hard-tabs)
142-142: Hard tabs
Column: 1(MD010, no-hard-tabs)
143-143: Hard tabs
Column: 1(MD010, no-hard-tabs)
144-144: Hard tabs
Column: 1(MD010, no-hard-tabs)
145-145: Hard tabs
Column: 1(MD010, no-hard-tabs)
147-147: Hard tabs
Column: 1(MD010, no-hard-tabs)
148-148: Hard tabs
Column: 1(MD010, no-hard-tabs)
149-149: Hard tabs
Column: 1(MD010, no-hard-tabs)
150-150: Hard tabs
Column: 1(MD010, no-hard-tabs)
152-152: Hard tabs
Column: 1(MD010, no-hard-tabs)
153-153: Hard tabs
Column: 1(MD010, no-hard-tabs)
154-154: Hard tabs
Column: 1(MD010, no-hard-tabs)
155-155: Hard tabs
Column: 1(MD010, no-hard-tabs)
157-157: Hard tabs
Column: 1(MD010, no-hard-tabs)
158-158: Hard tabs
Column: 1(MD010, no-hard-tabs)
159-159: Hard tabs
Column: 1(MD010, no-hard-tabs)
160-160: Hard tabs
Column: 1(MD010, no-hard-tabs)
162-162: Hard tabs
Column: 1(MD010, no-hard-tabs)
163-163: Hard tabs
Column: 1(MD010, no-hard-tabs)
164-164: Hard tabs
Column: 1(MD010, no-hard-tabs)
165-165: Hard tabs
Column: 1(MD010, no-hard-tabs)
167-167: Hard tabs
Column: 1(MD010, no-hard-tabs)
168-168: Hard tabs
Column: 1(MD010, no-hard-tabs)
169-169: Hard tabs
Column: 1(MD010, no-hard-tabs)
170-170: Hard tabs
Column: 1(MD010, no-hard-tabs)
172-172: Hard tabs
Column: 1(MD010, no-hard-tabs)
173-173: Hard tabs
Column: 1(MD010, no-hard-tabs)
174-174: Hard tabs
Column: 1(MD010, no-hard-tabs)
175-175: Hard tabs
Column: 1(MD010, no-hard-tabs)
182-182: Hard tabs
Column: 1(MD010, no-hard-tabs)
183-183: Hard tabs
Column: 1(MD010, no-hard-tabs)
184-184: Hard tabs
Column: 1(MD010, no-hard-tabs)
185-185: Hard tabs
Column: 1(MD010, no-hard-tabs)
186-186: Hard tabs
Column: 1(MD010, no-hard-tabs)
187-187: Hard tabs
Column: 1(MD010, no-hard-tabs)
188-188: Hard tabs
Column: 1(MD010, no-hard-tabs)
189-189: Hard tabs
Column: 1(MD010, no-hard-tabs)
190-190: Hard tabs
Column: 1(MD010, no-hard-tabs)
191-191: Hard tabs
Column: 1(MD010, no-hard-tabs)
192-192: Hard tabs
Column: 1(MD010, no-hard-tabs)
193-193: Hard tabs
Column: 1(MD010, no-hard-tabs)
194-194: Hard tabs
Column: 1(MD010, no-hard-tabs)
195-195: Hard tabs
Column: 1(MD010, no-hard-tabs)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
dragonfly/README.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
dragonfly/README.md
[style] ~6-~6: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 1134 characters long)
Context: ...ub/v/tag/gofiber/storage?filter=redis*)
![Security](https://img.shields.io/github...
(EN_EXCESSIVE_EXCLAMATION)
[misspelling] ~50-~50: Make sure that ‘the one of’ is correct and that ‘one’ is a pronoun. Possibly, the ‘the’ is unnecessary or ‘of’ is better expressed with a preposition such as ‘about’ or ‘in’.
Context: ...ber/storage/dragonfly" ``` You can use the one of the following options to create a Drago...
(THE_ONE_OF_DT)
🪛 markdownlint-cli2 (0.17.2)
dragonfly/README.md
14-14: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
57-57: Hard tabs
Column: 1
(MD010, no-hard-tabs)
58-58: Hard tabs
Column: 1
(MD010, no-hard-tabs)
59-59: Hard tabs
Column: 1
(MD010, no-hard-tabs)
60-60: Hard tabs
Column: 1
(MD010, no-hard-tabs)
61-61: Hard tabs
Column: 1
(MD010, no-hard-tabs)
62-62: Hard tabs
Column: 1
(MD010, no-hard-tabs)
63-63: Hard tabs
Column: 1
(MD010, no-hard-tabs)
64-64: Hard tabs
Column: 1
(MD010, no-hard-tabs)
69-69: Hard tabs
Column: 1
(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
81-81: Hard tabs
Column: 1
(MD010, no-hard-tabs)
82-82: Hard tabs
Column: 1
(MD010, no-hard-tabs)
85-85: Hard tabs
Column: 1
(MD010, no-hard-tabs)
86-86: Hard tabs
Column: 1
(MD010, no-hard-tabs)
87-87: Hard tabs
Column: 1
(MD010, no-hard-tabs)
90-90: Hard tabs
Column: 1
(MD010, no-hard-tabs)
90-90: Hard tabs
Column: 11
(MD010, no-hard-tabs)
91-91: Hard tabs
Column: 1
(MD010, no-hard-tabs)
91-91: Hard tabs
Column: 13
(MD010, no-hard-tabs)
92-92: Hard tabs
Column: 1
(MD010, no-hard-tabs)
92-92: Hard tabs
Column: 12
(MD010, no-hard-tabs)
98-98: Hard tabs
Column: 1
(MD010, no-hard-tabs)
99-99: Hard tabs
Column: 1
(MD010, no-hard-tabs)
106-106: Hard tabs
Column: 1
(MD010, no-hard-tabs)
107-107: Hard tabs
Column: 1
(MD010, no-hard-tabs)
108-108: Hard tabs
Column: 1
(MD010, no-hard-tabs)
109-109: Hard tabs
Column: 1
(MD010, no-hard-tabs)
111-111: Hard tabs
Column: 1
(MD010, no-hard-tabs)
112-112: Hard tabs
Column: 1
(MD010, no-hard-tabs)
113-113: Hard tabs
Column: 1
(MD010, no-hard-tabs)
114-114: Hard tabs
Column: 1
(MD010, no-hard-tabs)
116-116: Hard tabs
Column: 1
(MD010, no-hard-tabs)
117-117: Hard tabs
Column: 1
(MD010, no-hard-tabs)
118-118: Hard tabs
Column: 1
(MD010, no-hard-tabs)
119-119: Hard tabs
Column: 1
(MD010, no-hard-tabs)
121-121: Hard tabs
Column: 1
(MD010, no-hard-tabs)
122-122: Hard tabs
Column: 1
(MD010, no-hard-tabs)
123-123: Hard tabs
Column: 1
(MD010, no-hard-tabs)
124-124: Hard tabs
Column: 1
(MD010, no-hard-tabs)
126-126: Hard tabs
Column: 1
(MD010, no-hard-tabs)
127-127: Hard tabs
Column: 1
(MD010, no-hard-tabs)
128-128: Hard tabs
Column: 1
(MD010, no-hard-tabs)
129-129: Hard tabs
Column: 1
(MD010, no-hard-tabs)
131-131: Hard tabs
Column: 1
(MD010, no-hard-tabs)
132-132: Hard tabs
Column: 1
(MD010, no-hard-tabs)
133-133: Hard tabs
Column: 1
(MD010, no-hard-tabs)
134-134: Hard tabs
Column: 1
(MD010, no-hard-tabs)
135-135: Hard tabs
Column: 1
(MD010, no-hard-tabs)
137-137: Hard tabs
Column: 1
(MD010, no-hard-tabs)
138-138: Hard tabs
Column: 1
(MD010, no-hard-tabs)
139-139: Hard tabs
Column: 1
(MD010, no-hard-tabs)
140-140: Hard tabs
Column: 1
(MD010, no-hard-tabs)
142-142: Hard tabs
Column: 1
(MD010, no-hard-tabs)
143-143: Hard tabs
Column: 1
(MD010, no-hard-tabs)
144-144: Hard tabs
Column: 1
(MD010, no-hard-tabs)
145-145: Hard tabs
Column: 1
(MD010, no-hard-tabs)
147-147: Hard tabs
Column: 1
(MD010, no-hard-tabs)
148-148: Hard tabs
Column: 1
(MD010, no-hard-tabs)
149-149: Hard tabs
Column: 1
(MD010, no-hard-tabs)
150-150: Hard tabs
Column: 1
(MD010, no-hard-tabs)
152-152: Hard tabs
Column: 1
(MD010, no-hard-tabs)
153-153: Hard tabs
Column: 1
(MD010, no-hard-tabs)
154-154: Hard tabs
Column: 1
(MD010, no-hard-tabs)
155-155: Hard tabs
Column: 1
(MD010, no-hard-tabs)
157-157: Hard tabs
Column: 1
(MD010, no-hard-tabs)
158-158: Hard tabs
Column: 1
(MD010, no-hard-tabs)
159-159: Hard tabs
Column: 1
(MD010, no-hard-tabs)
160-160: Hard tabs
Column: 1
(MD010, no-hard-tabs)
162-162: Hard tabs
Column: 1
(MD010, no-hard-tabs)
163-163: Hard tabs
Column: 1
(MD010, no-hard-tabs)
164-164: Hard tabs
Column: 1
(MD010, no-hard-tabs)
165-165: Hard tabs
Column: 1
(MD010, no-hard-tabs)
167-167: Hard tabs
Column: 1
(MD010, no-hard-tabs)
168-168: Hard tabs
Column: 1
(MD010, no-hard-tabs)
169-169: Hard tabs
Column: 1
(MD010, no-hard-tabs)
170-170: Hard tabs
Column: 1
(MD010, no-hard-tabs)
172-172: Hard tabs
Column: 1
(MD010, no-hard-tabs)
173-173: Hard tabs
Column: 1
(MD010, no-hard-tabs)
174-174: Hard tabs
Column: 1
(MD010, no-hard-tabs)
175-175: Hard tabs
Column: 1
(MD010, no-hard-tabs)
182-182: Hard tabs
Column: 1
(MD010, no-hard-tabs)
183-183: Hard tabs
Column: 1
(MD010, no-hard-tabs)
184-184: Hard tabs
Column: 1
(MD010, no-hard-tabs)
185-185: Hard tabs
Column: 1
(MD010, no-hard-tabs)
186-186: Hard tabs
Column: 1
(MD010, no-hard-tabs)
187-187: Hard tabs
Column: 1
(MD010, no-hard-tabs)
188-188: Hard tabs
Column: 1
(MD010, no-hard-tabs)
189-189: Hard tabs
Column: 1
(MD010, no-hard-tabs)
190-190: Hard tabs
Column: 1
(MD010, no-hard-tabs)
191-191: Hard tabs
Column: 1
(MD010, no-hard-tabs)
192-192: Hard tabs
Column: 1
(MD010, no-hard-tabs)
193-193: Hard tabs
Column: 1
(MD010, no-hard-tabs)
194-194: Hard tabs
Column: 1
(MD010, no-hard-tabs)
195-195: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🔇 Additional comments (2)
dragonfly/README.md (2)
14-14
:⚠️ Potential issueUpdate Go version requirement.
Based on the previous review feedback, this should specify support for the latest two Go releases instead of a fixed version.
-**Note: Requires Go 1.21 and above** +**Note: Requires the two latest Go releases**Likely invalid or redundant comment.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
14-14: Emphasis used instead of a heading
null(MD036, no-emphasis-as-heading)
137-141
: Clarify Failover and Cluster configuration.The documentation should specify whether Dragonfly supports these Redis features and any differences in implementation.
Could you verify if Dragonfly supports Redis Sentinel and Cluster modes? This will help ensure we're not documenting unsupported features.
✅ Verification successful
Both Redis Sentinel and Cluster modes are supported
The codebase shows clear implementation of both Redis Sentinel and Cluster modes:
- Sentinel support is implemented with
MasterName
,SentinelUsername
, andSentinelPassword
configuration- Cluster mode is implemented and verified through
Test_Dragonfly_Cluster
tests- Both features can be enabled by providing appropriate addresses in the
Addrs
configuration field🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any documentation or discussions about Dragonfly's support for Redis Sentinel and Cluster modes rg -i "sentinel|cluster" -g "*.md" -A 5 -B 5Length of output: 12768
Script:
#!/bin/bash # Search for Sentinel and Cluster implementation details in source files echo "=== Searching for Sentinel implementation ===" ast-grep --pattern 'func $$$Sentinel$$$' echo -e "\n=== Searching for Cluster implementation ===" ast-grep --pattern 'func $$$Cluster$$$' echo -e "\n=== Searching for Failover implementation ===" ast-grep --pattern 'func $$$Failover$$$' echo -e "\n=== Searching for related imports and type definitions ===" rg "(Sentinel|Cluster|Failover)" -g "*.go" -A 3 -B 3Length of output: 6599
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
137-137: Hard tabs
Column: 1(MD010, no-hard-tabs)
138-138: Hard tabs
Column: 1(MD010, no-hard-tabs)
139-139: Hard tabs
Column: 1(MD010, no-hard-tabs)
140-140: Hard tabs
Column: 1(MD010, no-hard-tabs)
dragonfly/README.md
Outdated
![Release](https://img.shields.io/github/v/tag/gofiber/storage?filter=redis*) | ||
[![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord) | ||
![Test](https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-redis.yml?label=Tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update badge URLs to reflect Dragonfly package.
The badge URLs still reference Redis-related workflows and tags. These should be updated to point to Dragonfly-specific resources.
-![Release](https://img.shields.io/github/v/tag/gofiber/storage?filter=redis*)
-![Test](https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-redis.yml?label=Tests)
+![Release](https://img.shields.io/github/v/tag/gofiber/storage?filter=dragonfly*)
+![Test](https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-dragonfly.yml?label=Tests)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
![Release](https://img.shields.io/github/v/tag/gofiber/storage?filter=redis*) | |
[![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord) | |
![Test](https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-redis.yml?label=Tests) | |
![Release](https://img.shields.io/github/v/tag/gofiber/storage?filter=dragonfly*) | |
[![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord) | |
![Test](https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-dragonfly.yml?label=Tests) |
🧰 Tools
🪛 LanguageTool
[style] ~6-~6: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 1134 characters long)
Context: ...ub/v/tag/gofiber/storage?filter=redis*)
![Security](https://img.shields.io/github...
(EN_EXCESSIVE_EXCLAMATION)
Sounds good to me. Update the redis and rueidis docs with an example of how to use dragonfly. You can also add a test that uses dragonfly to those drivers |
- Added DragonflyDB usage details to Redis README - Removed the DragonflyDB file - No extra tests were added for DragonflyDB; existing Redis tests work for it
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
redis/redis.go (1)
16-20
: Documentation looks good! Consider adding practical examples.The documentation clearly explains DragonflyDB compatibility. To make it even more helpful for users, consider adding:
- A code example showing how to connect to DragonflyDB
- Any DragonflyDB-specific considerations or limitations
- A reference to the official DragonflyDB documentation
Here's a suggested addition to the documentation:
// New creates a new Redis storage instance. // // DragonflyDB is fully compatible with the Redis API, meaning it can be used as a drop-in replacement for Redis. // // Because of this compatibility, DragonflyDB can also be initialized through this function. +// +// Example usage with DragonflyDB: +// storage := redis.New(redis.Config{ +// URL: "redis://localhost:6379", // DragonflyDB default address +// }) +// +// For more details, see: https://www.dragonflydb.io/docs
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
redis/README.md
(2 hunks)redis/config.go
(1 hunks)redis/redis.go
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- redis/config.go
- redis/README.md
🔇 Additional comments (1)
redis/redis.go (1)
Line range hint
21-141
: Consider adding DragonflyDB-specific tests.While the implementation should work seamlessly with DragonflyDB due to Redis protocol compatibility, it would be beneficial to verify this through testing.
Consider adding a GitHub Actions workflow that runs the existing test suite against a DragonflyDB instance. This would help:
- Verify compatibility
- Catch any DragonflyDB-specific issues
- Ensure ongoing compatibility as both projects evolve
Here's a script to check if there are any existing DragonflyDB-related tests:
✅ Verification successful
Existing test suite is sufficient for DragonflyDB compatibility
The current test suite comprehensively covers all Redis protocol operations that DragonflyDB supports. Since DragonflyDB implements the Redis protocol, the existing tests will effectively verify compatibility. The test suite already includes:
- All standard Redis operations
- Various connection methods (single node, cluster)
- Different client implementations
- Connection pooling and TLS support
To use with DragonflyDB:
- Run the existing test suite against a DragonflyDB instance
- Update CI configuration to include DragonflyDB test runs
- Document verified DragonflyDB compatibility in README
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for existing DragonflyDB tests echo "Searching for DragonflyDB-related tests..." rg -i "dragonfly|dragonflydb" --type go --glob "*_test.go"Length of output: 155
Script:
#!/bin/bash # Find Redis test files and their content echo "=== Redis Test Files ===" fd -e go -g "*_test.go" --exec grep -l "redis" {} echo -e "\n=== Redis Test Setup Patterns ===" fd -e go -g "*_test.go" --exec grep -B2 -A5 "func Test.*Redis|func Test.*Storage|redis.NewUniversalClient" {}Length of output: 379
Script:
#!/bin/bash echo "=== Content of redis_test.go ===" cat redis/redis_test.go echo -e "\n=== Content of valkey_test.go ===" cat valkey/valkey_test.go echo -e "\n=== Content of rueidis_test.go ===" cat rueidis/rueidis_test.goLength of output: 21844
redis/README.md
Outdated
@@ -33,6 +33,12 @@ func (s *Storage) Keys() ([][]byte, error) | |||
``` | |||
### Installation | |||
Redis is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet: | |||
|
|||
> **Note:** You can also use [DragonflyDB](https://dragonflydb.io/) as a Redis replacement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove trailing spaces.
redis/redis.go
Outdated
// | ||
// DragonflyDB is fully compatible with the Redis API, meaning it can be used as a drop-in replacement for Redis. | ||
// | ||
// Because of this compatibility, DragonflyDB can also be initialized through this function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we need this new comments here. The ones in the README are enough.
redis/config.go
Outdated
@@ -6,6 +6,8 @@ import ( | |||
) | |||
|
|||
// Config defines the config for storage. | |||
// | |||
// Dragonfly and Redis share the same config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we need this new comments here. The ones in the README are enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary by CodeRabbit