Skip to content

Commit 64e2bde

Browse files
committed
Merge branch 'master' into apply-make-fmt
2 parents ead6979 + a7b4ce5 commit 64e2bde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1129
-638
lines changed

.github/actions/run-tests/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ runs:
2525
2626
# Mapping of redis version to redis testing containers
2727
declare -A redis_version_mapping=(
28-
["8.0-M05"]="8.0-M05-pre"
28+
["8.0-RC1"]="8.0-RC1-pre"
2929
["7.4.2"]="rs-7.4.0-v2"
3030
["7.2.7"]="rs-7.2.0-v14"
3131
)

.github/wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Lua
2929
MSSQL
3030
namespace
3131
NoSQL
32+
OpenTelemetry
3233
ORM
3334
Packagist
3435
PhpRedis

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
redis-version:
21-
- "8.0-M05" # 8.0 milestone 5
21+
- "8.0-RC1" # 8.0 RC1
2222
- "7.4.2" # should use redis stack 7.4
2323
go-version:
2424
- "1.23.x"
@@ -43,7 +43,7 @@ jobs:
4343
4444
# Mapping of redis version to redis testing containers
4545
declare -A redis_version_mapping=(
46-
["8.0-M05"]="8.0-M05-pre"
46+
["8.0-RC1"]="8.0-RC1-pre"
4747
["7.4.2"]="rs-7.4.0-v2"
4848
)
4949
if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then
@@ -72,7 +72,7 @@ jobs:
7272
fail-fast: false
7373
matrix:
7474
redis-version:
75-
- "8.0-M05" # 8.0 milestone 5
75+
- "8.0-RC1" # 8.0 RC1
7676
- "7.4.2" # should use redis stack 7.4
7777
- "7.2.7" # should redis stack 7.2
7878
go-version:

.github/workflows/golangci-lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ jobs:
2222
- uses: actions/checkout@v4
2323
- name: golangci-lint
2424
uses: golangci/[email protected]
25+
with:
26+
verify: false # disable verifying the configuration since golangci is currently introducing breaking changes in the configuration
27+

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Checkout
99
uses: actions/checkout@v4
1010
- name: Check Spelling
11-
uses: rojopolis/spellcheck-github-actions@0.47.0
11+
uses: rojopolis/spellcheck-github-actions@0.48.0
1212
with:
1313
config_path: .github/spellcheck-settings.yml
1414
task_name: Markdown

.github/workflows/test-redis-enterprise.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,4 @@ jobs:
5454
--ginkgo.skip-file="sentinel_test.go" \
5555
--ginkgo.skip-file="osscluster_test.go" \
5656
--ginkgo.skip-file="pubsub_test.go" \
57-
--ginkgo.skip-file="gears_commands_test.go" \
5857
--ginkgo.label-filter='!NonRedisEnterprise'

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,24 @@ func ExampleClient() *redis.Client {
167167

168168
```
169169

170+
### Instrument with OpenTelemetry
171+
172+
```go
173+
import (
174+
"github.com/redis/go-redis/v9"
175+
"github.com/redis/go-redis/extra/redisotel/v9"
176+
"errors"
177+
)
178+
179+
func main() {
180+
...
181+
rdb := redis.NewClient(&redis.Options{...})
182+
183+
if err := errors.Join(redisotel.InstrumentTracing(rdb), redisotel.InstrumentMetrics(rdb)); err != nil {
184+
log.Fatal(err)
185+
}
186+
```
187+
170188
171189
### Advanced Configuration
172190
@@ -215,9 +233,26 @@ val1 := client.FTSearchWithArgs(ctx, "txt", "foo bar", &redis.FTSearchOptions{})
215233
216234
In the Redis-Search module, **the default dialect is 2**. If needed, you can explicitly specify a different dialect using the appropriate configuration in your queries.
217235
218-
## Contributing
236+
**Important**: Be aware that the query dialect may impact the results returned. If needed, you can revert to a different dialect version by passing the desired dialect in the arguments of the command you want to execute.
237+
For example:
238+
```
239+
res2, err := rdb.FTSearchWithArgs(ctx,
240+
"idx:bicycle",
241+
"@pickup_zone:[CONTAINS $bike]",
242+
&redis.FTSearchOptions{
243+
Params: map[string]interface{}{
244+
"bike": "POINT(-0.1278 51.5074)",
245+
},
246+
DialectVersion: 3,
247+
},
248+
).Result()
249+
```
250+
You can find further details in the [query dialect documentation](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/).
219251
220-
Please see [out contributing guidelines](CONTRIBUTING.md) to help us improve this library!
252+
## Contributing
253+
We welcome contributions to the go-redis library! If you have a bug fix, feature request, or improvement, please open an issue or pull request on GitHub.
254+
We appreciate your help in making go-redis better for everyone.
255+
If you are interested in contributing to the go-redis library, please check out our [contributing guidelines](CONTRIBUTING.md) for more information on how to get started.
221256
222257
## Look and feel
223258

command.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3831,7 +3831,8 @@ func (cmd *MapStringStringSliceCmd) readReply(rd *proto.Reader) error {
38313831
}
38323832

38333833
// -----------------------------------------------------------------------
3834-
// MapStringInterfaceCmd represents a command that returns a map of strings to interface{}.
3834+
3835+
// MapMapStringInterfaceCmd represents a command that returns a map of strings to interface{}.
38353836
type MapMapStringInterfaceCmd struct {
38363837
baseCmd
38373838
val map[string]interface{}

commands.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ type Cmdable interface {
211211
ACLCmdable
212212
BitMapCmdable
213213
ClusterCmdable
214-
GearsCmdable
215214
GenericCmdable
216215
GeoCmdable
217216
HashCmdable
@@ -331,7 +330,7 @@ func (info LibraryInfo) Validate() error {
331330
return nil
332331
}
333332

334-
// Hello Set the resp protocol used.
333+
// Hello sets the resp protocol used.
335334
func (c statefulCmdable) Hello(ctx context.Context,
336335
ver int, username, password, clientName string,
337336
) *MapStringInterfaceCmd {
@@ -423,6 +422,12 @@ func (c cmdable) Ping(ctx context.Context) *StatusCmd {
423422
return cmd
424423
}
425424

425+
func (c cmdable) Do(ctx context.Context, args ...interface{}) *Cmd {
426+
cmd := NewCmd(ctx, args...)
427+
_ = c(ctx, cmd)
428+
return cmd
429+
}
430+
426431
func (c cmdable) Quit(_ context.Context) *StatusCmd {
427432
panic("not implemented")
428433
}

commands_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ var _ = Describe("Commands", func() {
8484
Expect(ping.Val()).To(Equal("PONG"))
8585
})
8686

87+
It("should Ping with Do method", func() {
88+
result := client.Conn().Do(ctx, "PING")
89+
Expect(result.Err()).NotTo(HaveOccurred())
90+
Expect(result.Val()).To(Equal("PONG"))
91+
})
92+
8793
It("should Wait", func() {
8894
const wait = 3 * time.Second
8995

0 commit comments

Comments
 (0)