-
Notifications
You must be signed in to change notification settings - Fork 29
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
Added hash and json support for Redis. #206
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds support for Redis hash and JSON producers to handle two different data formats, along with updates in the emitter and CLI commands to allow users to select the desired Redis data type.
- Introduces a new JSONProducer (and corresponding tests) alongside the existing HashProducer.
- Updates the emitter to create the proper Redis producer based on the output mode.
- Adjusts CLI flags and the producer list to include "redishash" and "redisjson" options.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/producers/redis/jsonProducer.go | New JSON producer implementation for storing JSON data |
pkg/producers/redis/hashProducer_test.go | Added tests for HashProducer |
pkg/producers/redis/hashProducer.go | Hash producer implementation |
pkg/producers/redis/jsonProducer_test.go | Added tests for JSONProducer |
pkg/emitter/emitter.go | Updated emitter to support both Redis hash and JSON producers |
pkg/cmd/templateRun.go | Updated CLI output flag descriptions to include redis options |
pkg/cmd/producerList.go | Updated producer list to display redisjson and redishash options |
Comments suppressed due to low confidence (1)
pkg/producers/redis/hashProducer.go:14
- Consider changing the Redis client field to a pointer (*redis.Client) to align with the go-redis library's intended usage and avoid potential issues with internal state management.
client redis.Client
) | ||
|
||
type JSONProducer struct { | ||
client redis.Client |
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.
Consider storing the Redis client as a pointer (*redis.Client) rather than a value to ensure proper client state management as intended by the go-redis library.
client redis.Client | |
client *redis.Client |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
LGTM! |
No description provided.