Skip to content

Commit d000e7c

Browse files
committed
update from main
Signed-off-by: EdricCua <ecuartero@google.com>
2 parents a69b613 + ba08ade commit d000e7c

26 files changed

+1505
-84
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@
1818
* Go: Add Cluster Scan support ([#3295](https://github.com/valkey-io/valkey-glide/pull/3295))
1919
* Go: Fix unsafe precondition violation for the slice::from_raw_parts ([#3350](https://github.com/valkey-io/valkey-glide/issues/3350))
2020
* Go: Add `GeoAdd` and the Geospatial interface ([#3366](https://github.com/valkey-io/valkey-glide/pull/3366))
21+
* Go: Add `LOLWUT` ([#3355](https://github.com/valkey-io/valkey-glide/pull/3355))
22+
* Go: Add `BITPOS` ([#3407](https://github.com/valkey-io/valkey-glide/pull/3407))
2123
* Go: Add `FLUSHALL` ([#3117](https://github.com/valkey-io/valkey-glide/pull/3117))
2224
* Go: Add `FLUSHDB` ([#3117](https://github.com/valkey-io/valkey-glide/pull/3117))
2325
* Go: Add password update api ([#3346](https://github.com/valkey-io/valkey-glide/pull/3346))
26+
* Go: Add `BITOP` ([#3384](https://github.com/valkey-io/valkey-glide/pull/3384))
2427
* Go: Add `GeoHash` ([#3439](https://github.com/valkey-io/valkey-glide/pull/3439))
2528
* Go/Core: Move FFI to a dedicated folder for reusability ([#3372](https://github.com/valkey-io/valkey-glide/pull/3372))
29+
* Go: Add `GeoPos` ([#3409](https://github.com/valkey-io/valkey-glide/pull/3409))
30+
* Go: Add `GeoDist` ([#3446](https://github.com/valkey-io/valkey-glide/pull/3446))
2631
* Go: Add `ClientId` ([#3077](https://github.com/valkey-io/valkey-glide/pull/3077))
2732

2833
#### Breaking Changes

README.md

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Valkey General Language Independent Driver for the Enterprise (GLIDE), is an ope
44
## Supported Engine Versions
55
Valkey GLIDE is API-compatible with the following engine versions:
66

7-
| Engine Type | 6.2 | 7.0 | 7.2 | 8.0 |
8-
|-----------------------|-------|-------|-------|-------|
9-
| Valkey | - | - | V | V |
10-
| Redis | V | V | V | - |
7+
| Engine Type | 6.2 | 7.0 | 7.1 | 7.2 | 8.0 |
8+
|-----------------------|-------|-------|-------|-------|-------|
9+
| Valkey | - | - | - | V | V |
10+
| Redis | V | V | V | V | - |
1111

1212
## Current Status and upcoming releases
1313
In the current release, Valkey GLIDE is available for Python, Java and Node.js. Support for Go is currently in **public preview** and support for C# is **under active development**, with plans to include more programming languages in the future.
@@ -40,31 +40,6 @@ If you have any questions, feature requests, encounter issues, or need assistanc
4040
9. Any unusual aspects of your environment or deployment
4141
10. Log files
4242

43-
## Known issues
44-
45-
GLIDE has a native component as a Rust based library. Currently the native component is not compatible with certain older GLIBC based OS's.
46-
The most relevant one is Debian 11, which is the base of ubuntu 20, which some other distros are based on, like Mint and Pop!_OS 20 etc. As a result, the ones mentioned above are incompatible with GLIDE.
47-
48-
Another OS which is known to be incompatible is Amazon Linux 2, which is the previous versions of what [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) is running on (node 18, py <=11, java <= 17). Note that this is not affecting MUSL based distros, which are not based on GLIBC.
49-
50-
For all the incompatible Linux distros listed, there's at least one newer and stable version available, and it is recommended to use them.
51-
52-
| Incompatible Distro Version | Compatible Successor Version |
53-
|-----------------------------|------------------------------|
54-
| Debian 11 | Debian 12 / 13 |
55-
| Ubuntu 20.04 LTS | Ubuntu 22.04 LTS / 24.04 LTS |
56-
| Linux Mint 20 | Linux Mint 21 / 22 |
57-
| Pop!_OS 20.04 LTS | Pop!_OS 22.04 LTS |
58-
| Amazon Linux 2 | Amazon Linux 2023 |
59-
60-
When running on incompatible systems, the client crashes with one of the following errors:
61-
```console
62-
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
63-
/lib64/libm.so.6: version `GLIBC_2.29' not found
64-
```
65-
You can get the `GLIBC` version included in your OS by running `ldd --version`. `GLIBC` versions `2.26`, `2.27`, `2.30`, and `2.31` are not supported.
66-
We are working hard to resolve this issue. You can track our progress in issue [#3291](https://github.com/valkey-io/valkey-glide/issues/3291).
67-
6843
## Contributing
6944

7045
GitHub is a platform for collaborative coding. If you're interested in writing code, we encourage you to contribute by submitting pull requests from forked copies of this repository. Additionally, please consider creating GitHub issues for reporting bugs and suggesting new features. Feel free to comment on issues that interest. For more info see [Contributing](./CONTRIBUTING.md).

go/api/base_client.go

Lines changed: 171 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5512,6 +5512,39 @@ func (client *baseClient) BitCount(key string) (int64, error) {
55125512
return handleIntResponse(result)
55135513
}
55145514

5515+
// Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination.
5516+
//
5517+
// Note:
5518+
//
5519+
// When in cluster mode, `destination` and all `keys` must map to the same hash slot.
5520+
//
5521+
// Parameters:
5522+
//
5523+
// bitwiseOperation - The bitwise operation to perform.
5524+
// destination - The key that will store the resulting string.
5525+
// keys - The list of keys to perform the bitwise operation on.
5526+
//
5527+
// Return value:
5528+
//
5529+
// The size of the string stored in destination.
5530+
//
5531+
// [valkey.io]: https://valkey.io/commands/bitop/
5532+
func (client *baseClient) BitOp(bitwiseOperation options.BitOpType, destination string, keys []string) (int64, error) {
5533+
bitOp, err := options.NewBitOp(bitwiseOperation, destination, keys)
5534+
if err != nil {
5535+
return defaultIntResponse, err
5536+
}
5537+
args, err := bitOp.ToArgs()
5538+
if err != nil {
5539+
return defaultIntResponse, err
5540+
}
5541+
result, err := client.executeCommand(C.BitOp, args)
5542+
if err != nil {
5543+
return defaultIntResponse, &errors.RequestError{Msg: "Bitop command execution failed"}
5544+
}
5545+
return handleIntResponse(result)
5546+
}
5547+
55155548
// Counts the number of set bits (population counting) in a string stored at key. The
55165549
// offsets start and end are zero-based indexes, with `0` being the first element of the
55175550
// list, `1` being the next element and so on. These offsets can also be negative numbers
@@ -5680,6 +5713,54 @@ func (client *baseClient) XClaimJustIdWithOptions(
56805713
return handleStringArrayResponse(result)
56815714
}
56825715

5716+
// Returns the position of the first bit matching the given bit value.
5717+
//
5718+
// Parameters:
5719+
//
5720+
// key - The key of the string.
5721+
// bit - The bit value to match. The value must be 0 or 1.
5722+
//
5723+
// Return value:
5724+
//
5725+
// The position of the first occurrence matching bit in the binary value of
5726+
// the string held at key. If bit is not found, a -1 is returned.
5727+
//
5728+
// [valkey.io]: https://valkey.io/commands/bitpos/
5729+
func (client *baseClient) BitPos(key string, bit int64) (int64, error) {
5730+
result, err := client.executeCommand(C.BitPos, []string{key, utils.IntToString(bit)})
5731+
if err != nil {
5732+
return defaultIntResponse, err
5733+
}
5734+
return handleIntResponse(result)
5735+
}
5736+
5737+
// Returns the position of the first bit matching the given bit value.
5738+
//
5739+
// Parameters:
5740+
//
5741+
// key - The key of the string.
5742+
// bit - The bit value to match. The value must be 0 or 1.
5743+
// bitposOptions - The [BitPosOptions] type.
5744+
//
5745+
// Return value:
5746+
//
5747+
// The position of the first occurrence matching bit in the binary value of
5748+
// the string held at key. If bit is not found, a -1 is returned.
5749+
//
5750+
// [valkey.io]: https://valkey.io/commands/bitpos/
5751+
func (client *baseClient) BitPosWithOptions(key string, bit int64, bitposOptions options.BitPosOptions) (int64, error) {
5752+
optionArgs, err := bitposOptions.ToArgs()
5753+
if err != nil {
5754+
return defaultIntResponse, err
5755+
}
5756+
commandArgs := append([]string{key, utils.IntToString(bit)}, optionArgs...)
5757+
result, err := client.executeCommand(C.BitPos, commandArgs)
5758+
if err != nil {
5759+
return defaultIntResponse, err
5760+
}
5761+
return handleIntResponse(result)
5762+
}
5763+
56835764
// Copies the value stored at the source to the destination key if the
56845765
// destination key does not yet exist.
56855766
//
@@ -6631,7 +6712,7 @@ func (client *baseClient) GeoAddWithOptions(
66316712
// Returns value:
66326713
//
66336714
// An array of GeoHash strings representing the positions of the specified members stored
6634-
// at key. If a member does not exist in the sorted set, a `null` value is returned
6715+
// at key. If a member does not exist in the sorted set, a `nil` value is returned
66356716
// for that member.
66366717
//
66376718
// [valkey.io]: https://valkey.io/commands/geohash/
@@ -6645,3 +6726,92 @@ func (client *baseClient) GeoHash(key string, members []string) ([]string, error
66456726
}
66466727
return handleStringArrayResponse(result)
66476728
}
6729+
6730+
// Returns the positions (longitude,latitude) of all the specified members of the
6731+
// geospatial index represented by the sorted set at key.
6732+
//
6733+
// See [valkey.io] for details.
6734+
//
6735+
// Parameters:
6736+
//
6737+
// key - The key of the sorted set.
6738+
// members - The members of the sorted set.
6739+
//
6740+
// Return value:
6741+
//
6742+
// A 2D `array` which represent positions (longitude and latitude) corresponding to the given members.
6743+
// If a member does not exist, its position will be `nil`.
6744+
//
6745+
// [valkey.io]: https://valkey.io/commands/geopos/
6746+
func (client *baseClient) GeoPos(key string, members []string) ([][]float64, error) {
6747+
args := []string{key}
6748+
args = append(args, members...)
6749+
result, err := client.executeCommand(C.GeoPos, args)
6750+
if err != nil {
6751+
return nil, err
6752+
}
6753+
return handle2DFloat64OrNullArrayResponse(result)
6754+
}
6755+
6756+
// Returns the distance between `member1` and `member2` saved in the
6757+
// geospatial index stored at `key`.
6758+
//
6759+
// See [valkey.io] for details.
6760+
//
6761+
// Parameters:
6762+
//
6763+
// key - The key of the sorted set.
6764+
// member1 - The name of the first member.
6765+
// member2 - The name of the second member.
6766+
//
6767+
// Return value:
6768+
//
6769+
// The distance between `member1` and `member2`. If one or both members do not exist,
6770+
// or if the key does not exist, returns `nil`. The default
6771+
// unit is meters, see - [options.Meters]
6772+
//
6773+
// [valkey.io]: https://valkey.io/commands/geodist/
6774+
func (client *baseClient) GeoDist(key string, member1 string, member2 string) (Result[float64], error) {
6775+
result, err := client.executeCommand(
6776+
C.GeoDist,
6777+
[]string{key, member1, member2},
6778+
)
6779+
if err != nil {
6780+
return CreateNilFloat64Result(), err
6781+
}
6782+
return handleFloatOrNilResponse(result)
6783+
}
6784+
6785+
// Returns the distance between `member1` and `member2` saved in the
6786+
// geospatial index stored at `key`.
6787+
//
6788+
// See [valkey.io] for details.
6789+
//
6790+
// Parameters:
6791+
//
6792+
// key - The key of the sorted set.
6793+
// member1 - The name of the first member.
6794+
// member2 - The name of the second member.
6795+
// unit - The unit of distance measurement - see [options.GeoUnit].
6796+
//
6797+
// Return value:
6798+
//
6799+
// The distance between `member1` and `member2`. If one or both members
6800+
// do not exist, or if the key does not exist, returns `nil`.
6801+
//
6802+
// [valkey.io]: https://valkey.io/commands/geodist/
6803+
func (client *baseClient) GeoDistWithUnit(
6804+
key string,
6805+
member1 string,
6806+
member2 string,
6807+
unit options.GeoUnit,
6808+
) (Result[float64], error) {
6809+
result, err := client.executeCommand(
6810+
C.GeoDist,
6811+
[]string{key, member1, member2, string(unit)},
6812+
)
6813+
if err != nil {
6814+
return CreateNilFloat64Result(), err
6815+
}
6816+
return handleFloatOrNilResponse(result)
6817+
}

go/api/bitmap_commands.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ type BitmapCommands interface {
1818

1919
BitCountWithOptions(key string, options options.BitCountOptions) (int64, error)
2020

21+
BitPos(key string, bit int64) (int64, error)
22+
23+
BitPosWithOptions(key string, bit int64, options options.BitPosOptions) (int64, error)
24+
2125
BitField(key string, subCommands []options.BitFieldSubCommands) ([]Result[int64], error)
2226

2327
BitFieldRO(key string, commands []options.BitFieldROCommands) ([]Result[int64], error)
28+
29+
BitOp(bitwiseOperation options.BitOpType, destination string, keys []string) (int64, error)
2430
}

0 commit comments

Comments
 (0)