Bump github.com/redis/go-redis/v9 from 9.7.0 to 9.7.1
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.7.0 to 9.7.1. - [Release notes](https://github.com/redis/go-redis/releases) - [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md) - [Commits](https://github.com/redis/go-redis/compare/v9.7.0...v9.7.1) --- updated-dependencies: - dependency-name: github.com/redis/go-redis/v9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
e7281b1d9a
commit
b1c4d6f81b
13 changed files with 110 additions and 54 deletions
2
go.mod
2
go.mod
|
|
@ -16,7 +16,7 @@ require (
|
||||||
github.com/lib/pq v1.10.9
|
github.com/lib/pq v1.10.9
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/prometheus/client_golang v1.20.5
|
github.com/prometheus/client_golang v1.20.5
|
||||||
github.com/redis/go-redis/v9 v9.7.0
|
github.com/redis/go-redis/v9 v9.7.1
|
||||||
golang.org/x/sync v0.10.0
|
golang.org/x/sync v0.10.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
4
go.sum
4
go.sum
|
|
@ -98,8 +98,8 @@ github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ
|
||||||
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
|
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
|
||||||
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
||||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||||
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
|
github.com/redis/go-redis/v9 v9.7.1 h1:4LhKRCIduqXqtvCUlaq9c8bdHOkICjDMrr1+Zb3osAc=
|
||||||
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
|
github.com/redis/go-redis/v9 v9.7.1/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||||
|
|
|
||||||
3
vendor/github.com/redis/go-redis/v9/.golangci.yml
generated
vendored
3
vendor/github.com/redis/go-redis/v9/.golangci.yml
generated
vendored
|
|
@ -1,4 +1,3 @@
|
||||||
run:
|
run:
|
||||||
concurrency: 8
|
timeout: 5m
|
||||||
deadline: 5m
|
|
||||||
tests: false
|
tests: false
|
||||||
|
|
|
||||||
15
vendor/github.com/redis/go-redis/v9/README.md
generated
vendored
15
vendor/github.com/redis/go-redis/v9/README.md
generated
vendored
|
|
@ -186,6 +186,21 @@ rdb := redis.NewClient(&redis.Options{
|
||||||
#### Unstable RESP3 Structures for RediSearch Commands
|
#### Unstable RESP3 Structures for RediSearch Commands
|
||||||
When integrating Redis with application functionalities using RESP3, it's important to note that some response structures aren't final yet. This is especially true for more complex structures like search and query results. We recommend using RESP2 when using the search and query capabilities, but we plan to stabilize the RESP3-based API-s in the coming versions. You can find more guidance in the upcoming release notes.
|
When integrating Redis with application functionalities using RESP3, it's important to note that some response structures aren't final yet. This is especially true for more complex structures like search and query results. We recommend using RESP2 when using the search and query capabilities, but we plan to stabilize the RESP3-based API-s in the coming versions. You can find more guidance in the upcoming release notes.
|
||||||
|
|
||||||
|
To enable unstable RESP3, set the option in your client configuration:
|
||||||
|
|
||||||
|
```go
|
||||||
|
redis.NewClient(&redis.Options{
|
||||||
|
UnstableResp3: true,
|
||||||
|
})
|
||||||
|
```
|
||||||
|
**Note:** When UnstableResp3 mode is enabled, it's necessary to use RawResult() and RawVal() to retrieve a raw data.
|
||||||
|
Since, raw response is the only option for unstable search commands Val() and Result() calls wouldn't have any affect on them:
|
||||||
|
|
||||||
|
```go
|
||||||
|
res1, err := client.FTSearchWithArgs(ctx, "txt", "foo bar", &redis.FTSearchOptions{}).RawResult()
|
||||||
|
val1 := client.FTSearchWithArgs(ctx, "txt", "foo bar", &redis.FTSearchOptions{}).RawVal()
|
||||||
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Please see [out contributing guidelines](CONTRIBUTING.md) to help us improve this library!
|
Please see [out contributing guidelines](CONTRIBUTING.md) to help us improve this library!
|
||||||
|
|
|
||||||
2
vendor/github.com/redis/go-redis/v9/command.go
generated
vendored
2
vendor/github.com/redis/go-redis/v9/command.go
generated
vendored
|
|
@ -167,6 +167,8 @@ func (cmd *baseCmd) stringArg(pos int) string {
|
||||||
switch v := arg.(type) {
|
switch v := arg.(type) {
|
||||||
case string:
|
case string:
|
||||||
return v
|
return v
|
||||||
|
case []byte:
|
||||||
|
return string(v)
|
||||||
default:
|
default:
|
||||||
// TODO: consider using appendArg
|
// TODO: consider using appendArg
|
||||||
return fmt.Sprint(v)
|
return fmt.Sprint(v)
|
||||||
|
|
|
||||||
2
vendor/github.com/redis/go-redis/v9/hash_commands.go
generated
vendored
2
vendor/github.com/redis/go-redis/v9/hash_commands.go
generated
vendored
|
|
@ -225,7 +225,7 @@ func (c cmdable) HExpire(ctx context.Context, key string, expiration time.Durati
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// HExpire - Sets the expiration time for specified fields in a hash in seconds.
|
// HExpireWithArgs - Sets the expiration time for specified fields in a hash in seconds.
|
||||||
// It requires a key, an expiration duration, a struct with boolean flags for conditional expiration settings (NX, XX, GT, LT), and a list of fields.
|
// It requires a key, an expiration duration, a struct with boolean flags for conditional expiration settings (NX, XX, GT, LT), and a list of fields.
|
||||||
// The command constructs an argument list starting with "HEXPIRE", followed by the key, duration, any conditional flags, and the specified fields.
|
// The command constructs an argument list starting with "HEXPIRE", followed by the key, duration, any conditional flags, and the specified fields.
|
||||||
// For more information - https://redis.io/commands/hexpire/
|
// For more information - https://redis.io/commands/hexpire/
|
||||||
|
|
|
||||||
2
vendor/github.com/redis/go-redis/v9/options.go
generated
vendored
2
vendor/github.com/redis/go-redis/v9/options.go
generated
vendored
|
|
@ -154,7 +154,7 @@ type Options struct {
|
||||||
// Add suffix to client name. Default is empty.
|
// Add suffix to client name. Default is empty.
|
||||||
IdentitySuffix string
|
IdentitySuffix string
|
||||||
|
|
||||||
// Enable Unstable mode for Redis Search module with RESP3.
|
// UnstableResp3 enables Unstable mode for Redis Search module with RESP3.
|
||||||
UnstableResp3 bool
|
UnstableResp3 bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
10
vendor/github.com/redis/go-redis/v9/osscluster.go
generated
vendored
10
vendor/github.com/redis/go-redis/v9/osscluster.go
generated
vendored
|
|
@ -90,6 +90,9 @@ type ClusterOptions struct {
|
||||||
DisableIndentity bool // Disable set-lib on connect. Default is false.
|
DisableIndentity bool // Disable set-lib on connect. Default is false.
|
||||||
|
|
||||||
IdentitySuffix string // Add suffix to client name. Default is empty.
|
IdentitySuffix string // Add suffix to client name. Default is empty.
|
||||||
|
|
||||||
|
// UnstableResp3 enables Unstable mode for Redis Search module with RESP3.
|
||||||
|
UnstableResp3 bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *ClusterOptions) init() {
|
func (opt *ClusterOptions) init() {
|
||||||
|
|
@ -305,6 +308,7 @@ func (opt *ClusterOptions) clientOptions() *Options {
|
||||||
// READONLY command against that node -- setting readOnly to false in such
|
// READONLY command against that node -- setting readOnly to false in such
|
||||||
// situations in the options below will prevent that from happening.
|
// situations in the options below will prevent that from happening.
|
||||||
readOnly: opt.ReadOnly && opt.ClusterSlots == nil,
|
readOnly: opt.ReadOnly && opt.ClusterSlots == nil,
|
||||||
|
UnstableResp3: opt.UnstableResp3,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -465,9 +469,11 @@ func (c *clusterNodes) Addrs() ([]string, error) {
|
||||||
closed := c.closed //nolint:ifshort
|
closed := c.closed //nolint:ifshort
|
||||||
if !closed {
|
if !closed {
|
||||||
if len(c.activeAddrs) > 0 {
|
if len(c.activeAddrs) > 0 {
|
||||||
addrs = c.activeAddrs
|
addrs = make([]string, len(c.activeAddrs))
|
||||||
|
copy(addrs, c.activeAddrs)
|
||||||
} else {
|
} else {
|
||||||
addrs = c.addrs
|
addrs = make([]string, len(c.addrs))
|
||||||
|
copy(addrs, c.addrs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.mu.RUnlock()
|
c.mu.RUnlock()
|
||||||
|
|
|
||||||
17
vendor/github.com/redis/go-redis/v9/redis.go
generated
vendored
17
vendor/github.com/redis/go-redis/v9/redis.go
generated
vendored
|
|
@ -41,7 +41,7 @@ type (
|
||||||
)
|
)
|
||||||
|
|
||||||
type hooksMixin struct {
|
type hooksMixin struct {
|
||||||
hooksMu *sync.Mutex
|
hooksMu *sync.RWMutex
|
||||||
|
|
||||||
slice []Hook
|
slice []Hook
|
||||||
initial hooks
|
initial hooks
|
||||||
|
|
@ -49,7 +49,7 @@ type hooksMixin struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (hs *hooksMixin) initHooks(hooks hooks) {
|
func (hs *hooksMixin) initHooks(hooks hooks) {
|
||||||
hs.hooksMu = new(sync.Mutex)
|
hs.hooksMu = new(sync.RWMutex)
|
||||||
hs.initial = hooks
|
hs.initial = hooks
|
||||||
hs.chain()
|
hs.chain()
|
||||||
}
|
}
|
||||||
|
|
@ -151,7 +151,7 @@ func (hs *hooksMixin) clone() hooksMixin {
|
||||||
clone := *hs
|
clone := *hs
|
||||||
l := len(clone.slice)
|
l := len(clone.slice)
|
||||||
clone.slice = clone.slice[:l:l]
|
clone.slice = clone.slice[:l:l]
|
||||||
clone.hooksMu = new(sync.Mutex)
|
clone.hooksMu = new(sync.RWMutex)
|
||||||
return clone
|
return clone
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -176,9 +176,14 @@ func (hs *hooksMixin) withProcessPipelineHook(
|
||||||
}
|
}
|
||||||
|
|
||||||
func (hs *hooksMixin) dialHook(ctx context.Context, network, addr string) (net.Conn, error) {
|
func (hs *hooksMixin) dialHook(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||||
hs.hooksMu.Lock()
|
// Access to hs.current is guarded by a read-only lock since it may be mutated by AddHook(...)
|
||||||
defer hs.hooksMu.Unlock()
|
// while this dialer is concurrently accessed by the background connection pool population
|
||||||
return hs.current.dial(ctx, network, addr)
|
// routine when MinIdleConns > 0.
|
||||||
|
hs.hooksMu.RLock()
|
||||||
|
current := hs.current
|
||||||
|
hs.hooksMu.RUnlock()
|
||||||
|
|
||||||
|
return current.dial(ctx, network, addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (hs *hooksMixin) processHook(ctx context.Context, cmd Cmder) error {
|
func (hs *hooksMixin) processHook(ctx context.Context, cmd Cmder) error {
|
||||||
|
|
|
||||||
100
vendor/github.com/redis/go-redis/v9/search_commands.go
generated
vendored
100
vendor/github.com/redis/go-redis/v9/search_commands.go
generated
vendored
|
|
@ -247,6 +247,8 @@ type FTAggregateOptions struct {
|
||||||
GroupBy []FTAggregateGroupBy
|
GroupBy []FTAggregateGroupBy
|
||||||
SortBy []FTAggregateSortBy
|
SortBy []FTAggregateSortBy
|
||||||
SortByMax int
|
SortByMax int
|
||||||
|
Scorer string
|
||||||
|
AddScores bool
|
||||||
Apply []FTAggregateApply
|
Apply []FTAggregateApply
|
||||||
LimitOffset int
|
LimitOffset int
|
||||||
Limit int
|
Limit int
|
||||||
|
|
@ -483,6 +485,15 @@ func FTAggregateQuery(query string, options *FTAggregateOptions) AggregateQuery
|
||||||
if options.Verbatim {
|
if options.Verbatim {
|
||||||
queryArgs = append(queryArgs, "VERBATIM")
|
queryArgs = append(queryArgs, "VERBATIM")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.Scorer != "" {
|
||||||
|
queryArgs = append(queryArgs, "SCORER", options.Scorer)
|
||||||
|
}
|
||||||
|
|
||||||
|
if options.AddScores {
|
||||||
|
queryArgs = append(queryArgs, "ADDSCORES")
|
||||||
|
}
|
||||||
|
|
||||||
if options.LoadAll && options.Load != nil {
|
if options.LoadAll && options.Load != nil {
|
||||||
panic("FT.AGGREGATE: LOADALL and LOAD are mutually exclusive")
|
panic("FT.AGGREGATE: LOADALL and LOAD are mutually exclusive")
|
||||||
}
|
}
|
||||||
|
|
@ -491,16 +502,29 @@ func FTAggregateQuery(query string, options *FTAggregateOptions) AggregateQuery
|
||||||
}
|
}
|
||||||
if options.Load != nil {
|
if options.Load != nil {
|
||||||
queryArgs = append(queryArgs, "LOAD", len(options.Load))
|
queryArgs = append(queryArgs, "LOAD", len(options.Load))
|
||||||
|
index, count := len(queryArgs)-1, 0
|
||||||
for _, load := range options.Load {
|
for _, load := range options.Load {
|
||||||
queryArgs = append(queryArgs, load.Field)
|
queryArgs = append(queryArgs, load.Field)
|
||||||
|
count++
|
||||||
if load.As != "" {
|
if load.As != "" {
|
||||||
queryArgs = append(queryArgs, "AS", load.As)
|
queryArgs = append(queryArgs, "AS", load.As)
|
||||||
|
count += 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
queryArgs[index] = count
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.Timeout > 0 {
|
if options.Timeout > 0 {
|
||||||
queryArgs = append(queryArgs, "TIMEOUT", options.Timeout)
|
queryArgs = append(queryArgs, "TIMEOUT", options.Timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, apply := range options.Apply {
|
||||||
|
queryArgs = append(queryArgs, "APPLY", apply.Field)
|
||||||
|
if apply.As != "" {
|
||||||
|
queryArgs = append(queryArgs, "AS", apply.As)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if options.GroupBy != nil {
|
if options.GroupBy != nil {
|
||||||
for _, groupBy := range options.GroupBy {
|
for _, groupBy := range options.GroupBy {
|
||||||
queryArgs = append(queryArgs, "GROUPBY", len(groupBy.Fields))
|
queryArgs = append(queryArgs, "GROUPBY", len(groupBy.Fields))
|
||||||
|
|
@ -542,17 +566,8 @@ func FTAggregateQuery(query string, options *FTAggregateOptions) AggregateQuery
|
||||||
if options.SortByMax > 0 {
|
if options.SortByMax > 0 {
|
||||||
queryArgs = append(queryArgs, "MAX", options.SortByMax)
|
queryArgs = append(queryArgs, "MAX", options.SortByMax)
|
||||||
}
|
}
|
||||||
for _, apply := range options.Apply {
|
if options.LimitOffset >= 0 && options.Limit > 0 {
|
||||||
queryArgs = append(queryArgs, "APPLY", apply.Field)
|
queryArgs = append(queryArgs, "LIMIT", options.LimitOffset, options.Limit)
|
||||||
if apply.As != "" {
|
|
||||||
queryArgs = append(queryArgs, "AS", apply.As)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if options.LimitOffset > 0 {
|
|
||||||
queryArgs = append(queryArgs, "LIMIT", options.LimitOffset)
|
|
||||||
}
|
|
||||||
if options.Limit > 0 {
|
|
||||||
queryArgs = append(queryArgs, options.Limit)
|
|
||||||
}
|
}
|
||||||
if options.Filter != "" {
|
if options.Filter != "" {
|
||||||
queryArgs = append(queryArgs, "FILTER", options.Filter)
|
queryArgs = append(queryArgs, "FILTER", options.Filter)
|
||||||
|
|
@ -574,6 +589,7 @@ func FTAggregateQuery(query string, options *FTAggregateOptions) AggregateQuery
|
||||||
queryArgs = append(queryArgs, key, value)
|
queryArgs = append(queryArgs, key, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.DialectVersion > 0 {
|
if options.DialectVersion > 0 {
|
||||||
queryArgs = append(queryArgs, "DIALECT", options.DialectVersion)
|
queryArgs = append(queryArgs, "DIALECT", options.DialectVersion)
|
||||||
}
|
}
|
||||||
|
|
@ -653,12 +669,11 @@ func (cmd *AggregateCmd) String() string {
|
||||||
func (cmd *AggregateCmd) readReply(rd *proto.Reader) (err error) {
|
func (cmd *AggregateCmd) readReply(rd *proto.Reader) (err error) {
|
||||||
data, err := rd.ReadSlice()
|
data, err := rd.ReadSlice()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.err = err
|
return err
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
cmd.val, err = ProcessAggregateResult(data)
|
cmd.val, err = ProcessAggregateResult(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.err = err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -674,6 +689,12 @@ func (c cmdable) FTAggregateWithArgs(ctx context.Context, index string, query st
|
||||||
if options.Verbatim {
|
if options.Verbatim {
|
||||||
args = append(args, "VERBATIM")
|
args = append(args, "VERBATIM")
|
||||||
}
|
}
|
||||||
|
if options.Scorer != "" {
|
||||||
|
args = append(args, "SCORER", options.Scorer)
|
||||||
|
}
|
||||||
|
if options.AddScores {
|
||||||
|
args = append(args, "ADDSCORES")
|
||||||
|
}
|
||||||
if options.LoadAll && options.Load != nil {
|
if options.LoadAll && options.Load != nil {
|
||||||
panic("FT.AGGREGATE: LOADALL and LOAD are mutually exclusive")
|
panic("FT.AGGREGATE: LOADALL and LOAD are mutually exclusive")
|
||||||
}
|
}
|
||||||
|
|
@ -682,16 +703,26 @@ func (c cmdable) FTAggregateWithArgs(ctx context.Context, index string, query st
|
||||||
}
|
}
|
||||||
if options.Load != nil {
|
if options.Load != nil {
|
||||||
args = append(args, "LOAD", len(options.Load))
|
args = append(args, "LOAD", len(options.Load))
|
||||||
|
index, count := len(args)-1, 0
|
||||||
for _, load := range options.Load {
|
for _, load := range options.Load {
|
||||||
args = append(args, load.Field)
|
args = append(args, load.Field)
|
||||||
|
count++
|
||||||
if load.As != "" {
|
if load.As != "" {
|
||||||
args = append(args, "AS", load.As)
|
args = append(args, "AS", load.As)
|
||||||
|
count += 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
args[index] = count
|
||||||
}
|
}
|
||||||
if options.Timeout > 0 {
|
if options.Timeout > 0 {
|
||||||
args = append(args, "TIMEOUT", options.Timeout)
|
args = append(args, "TIMEOUT", options.Timeout)
|
||||||
}
|
}
|
||||||
|
for _, apply := range options.Apply {
|
||||||
|
args = append(args, "APPLY", apply.Field)
|
||||||
|
if apply.As != "" {
|
||||||
|
args = append(args, "AS", apply.As)
|
||||||
|
}
|
||||||
|
}
|
||||||
if options.GroupBy != nil {
|
if options.GroupBy != nil {
|
||||||
for _, groupBy := range options.GroupBy {
|
for _, groupBy := range options.GroupBy {
|
||||||
args = append(args, "GROUPBY", len(groupBy.Fields))
|
args = append(args, "GROUPBY", len(groupBy.Fields))
|
||||||
|
|
@ -733,17 +764,8 @@ func (c cmdable) FTAggregateWithArgs(ctx context.Context, index string, query st
|
||||||
if options.SortByMax > 0 {
|
if options.SortByMax > 0 {
|
||||||
args = append(args, "MAX", options.SortByMax)
|
args = append(args, "MAX", options.SortByMax)
|
||||||
}
|
}
|
||||||
for _, apply := range options.Apply {
|
if options.LimitOffset >= 0 && options.Limit > 0 {
|
||||||
args = append(args, "APPLY", apply.Field)
|
args = append(args, "LIMIT", options.LimitOffset, options.Limit)
|
||||||
if apply.As != "" {
|
|
||||||
args = append(args, "AS", apply.As)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if options.LimitOffset > 0 {
|
|
||||||
args = append(args, "LIMIT", options.LimitOffset)
|
|
||||||
}
|
|
||||||
if options.Limit > 0 {
|
|
||||||
args = append(args, options.Limit)
|
|
||||||
}
|
}
|
||||||
if options.Filter != "" {
|
if options.Filter != "" {
|
||||||
args = append(args, "FILTER", options.Filter)
|
args = append(args, "FILTER", options.Filter)
|
||||||
|
|
@ -1380,7 +1402,7 @@ func (cmd *FTInfoCmd) readReply(rd *proto.Reader) (err error) {
|
||||||
}
|
}
|
||||||
cmd.val, err = parseFTInfo(data)
|
cmd.val, err = parseFTInfo(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.err = err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -1473,12 +1495,11 @@ func (cmd *FTSpellCheckCmd) RawResult() (interface{}, error) {
|
||||||
func (cmd *FTSpellCheckCmd) readReply(rd *proto.Reader) (err error) {
|
func (cmd *FTSpellCheckCmd) readReply(rd *proto.Reader) (err error) {
|
||||||
data, err := rd.ReadSlice()
|
data, err := rd.ReadSlice()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.err = err
|
return err
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
cmd.val, err = parseFTSpellCheck(data)
|
cmd.val, err = parseFTSpellCheck(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.err = err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -1662,19 +1683,19 @@ func (cmd *FTSearchCmd) RawResult() (interface{}, error) {
|
||||||
func (cmd *FTSearchCmd) readReply(rd *proto.Reader) (err error) {
|
func (cmd *FTSearchCmd) readReply(rd *proto.Reader) (err error) {
|
||||||
data, err := rd.ReadSlice()
|
data, err := rd.ReadSlice()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.err = err
|
return err
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
cmd.val, err = parseFTSearch(data, cmd.options.NoContent, cmd.options.WithScores, cmd.options.WithPayloads, cmd.options.WithSortKeys)
|
cmd.val, err = parseFTSearch(data, cmd.options.NoContent, cmd.options.WithScores, cmd.options.WithPayloads, cmd.options.WithSortKeys)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.err = err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// FTSearch - Executes a search query on an index.
|
// FTSearch - Executes a search query on an index.
|
||||||
// The 'index' parameter specifies the index to search, and the 'query' parameter specifies the search query.
|
// The 'index' parameter specifies the index to search, and the 'query' parameter specifies the search query.
|
||||||
// For more information, please refer to the Redis documentation:
|
// For more information, please refer to the Redis documentation about [FT.SEARCH].
|
||||||
|
//
|
||||||
// [FT.SEARCH]: (https://redis.io/commands/ft.search/)
|
// [FT.SEARCH]: (https://redis.io/commands/ft.search/)
|
||||||
func (c cmdable) FTSearch(ctx context.Context, index string, query string) *FTSearchCmd {
|
func (c cmdable) FTSearch(ctx context.Context, index string, query string) *FTSearchCmd {
|
||||||
args := []interface{}{"FT.SEARCH", index, query}
|
args := []interface{}{"FT.SEARCH", index, query}
|
||||||
|
|
@ -1685,6 +1706,12 @@ func (c cmdable) FTSearch(ctx context.Context, index string, query string) *FTSe
|
||||||
|
|
||||||
type SearchQuery []interface{}
|
type SearchQuery []interface{}
|
||||||
|
|
||||||
|
// FTSearchQuery - Executes a search query on an index with additional options.
|
||||||
|
// The 'index' parameter specifies the index to search, the 'query' parameter specifies the search query,
|
||||||
|
// and the 'options' parameter specifies additional options for the search.
|
||||||
|
// For more information, please refer to the Redis documentation about [FT.SEARCH].
|
||||||
|
//
|
||||||
|
// [FT.SEARCH]: (https://redis.io/commands/ft.search/)
|
||||||
func FTSearchQuery(query string, options *FTSearchOptions) SearchQuery {
|
func FTSearchQuery(query string, options *FTSearchOptions) SearchQuery {
|
||||||
queryArgs := []interface{}{query}
|
queryArgs := []interface{}{query}
|
||||||
if options != nil {
|
if options != nil {
|
||||||
|
|
@ -1775,7 +1802,7 @@ func FTSearchQuery(query string, options *FTSearchOptions) SearchQuery {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if options.SortByWithCount {
|
if options.SortByWithCount {
|
||||||
queryArgs = append(queryArgs, "WITHCOUT")
|
queryArgs = append(queryArgs, "WITHCOUNT")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if options.LimitOffset >= 0 && options.Limit > 0 {
|
if options.LimitOffset >= 0 && options.Limit > 0 {
|
||||||
|
|
@ -1797,7 +1824,8 @@ func FTSearchQuery(query string, options *FTSearchOptions) SearchQuery {
|
||||||
// FTSearchWithArgs - Executes a search query on an index with additional options.
|
// FTSearchWithArgs - Executes a search query on an index with additional options.
|
||||||
// The 'index' parameter specifies the index to search, the 'query' parameter specifies the search query,
|
// The 'index' parameter specifies the index to search, the 'query' parameter specifies the search query,
|
||||||
// and the 'options' parameter specifies additional options for the search.
|
// and the 'options' parameter specifies additional options for the search.
|
||||||
// For more information, please refer to the Redis documentation:
|
// For more information, please refer to the Redis documentation about [FT.SEARCH].
|
||||||
|
//
|
||||||
// [FT.SEARCH]: (https://redis.io/commands/ft.search/)
|
// [FT.SEARCH]: (https://redis.io/commands/ft.search/)
|
||||||
func (c cmdable) FTSearchWithArgs(ctx context.Context, index string, query string, options *FTSearchOptions) *FTSearchCmd {
|
func (c cmdable) FTSearchWithArgs(ctx context.Context, index string, query string, options *FTSearchOptions) *FTSearchCmd {
|
||||||
args := []interface{}{"FT.SEARCH", index, query}
|
args := []interface{}{"FT.SEARCH", index, query}
|
||||||
|
|
@ -1889,7 +1917,7 @@ func (c cmdable) FTSearchWithArgs(ctx context.Context, index string, query strin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if options.SortByWithCount {
|
if options.SortByWithCount {
|
||||||
args = append(args, "WITHCOUT")
|
args = append(args, "WITHCOUNT")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if options.LimitOffset >= 0 && options.Limit > 0 {
|
if options.LimitOffset >= 0 && options.Limit > 0 {
|
||||||
|
|
|
||||||
1
vendor/github.com/redis/go-redis/v9/universal.go
generated
vendored
1
vendor/github.com/redis/go-redis/v9/universal.go
generated
vendored
|
|
@ -115,6 +115,7 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
|
||||||
|
|
||||||
DisableIndentity: o.DisableIndentity,
|
DisableIndentity: o.DisableIndentity,
|
||||||
IdentitySuffix: o.IdentitySuffix,
|
IdentitySuffix: o.IdentitySuffix,
|
||||||
|
UnstableResp3: o.UnstableResp3,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/github.com/redis/go-redis/v9/version.go
generated
vendored
2
vendor/github.com/redis/go-redis/v9/version.go
generated
vendored
|
|
@ -2,5 +2,5 @@ package redis
|
||||||
|
|
||||||
// Version is the current release version.
|
// Version is the current release version.
|
||||||
func Version() string {
|
func Version() string {
|
||||||
return "9.7.0"
|
return "9.7.1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
|
|
@ -190,7 +190,7 @@ github.com/prometheus/common/model
|
||||||
github.com/prometheus/procfs
|
github.com/prometheus/procfs
|
||||||
github.com/prometheus/procfs/internal/fs
|
github.com/prometheus/procfs/internal/fs
|
||||||
github.com/prometheus/procfs/internal/util
|
github.com/prometheus/procfs/internal/util
|
||||||
# github.com/redis/go-redis/v9 v9.7.0
|
# github.com/redis/go-redis/v9 v9.7.1
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/redis/go-redis/v9
|
github.com/redis/go-redis/v9
|
||||||
github.com/redis/go-redis/v9/internal
|
github.com/redis/go-redis/v9/internal
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue