From d0858962c3547c2898484cc7a0a7c99749233e08 Mon Sep 17 00:00:00 2001 From: Khosrow Afroozeh Date: Thu, 12 Dec 2024 17:54:31 +0100 Subject: [PATCH] Upgrade To Version 8 --- .github/workflows/build.yml | 6 +- .testcoverage.yml | 7 +- .travis.yml | 75 -------- .travis/aerospike.conf | 60 ------- .travis/proxy_check.sh | 15 -- .travis/wait_for_node.sh | 38 ---- CHANGELOG.md | 11 +- README.md | 41 ++--- admin_command.go | 6 +- aerospike_bench_reflect_test.go | 2 +- aerospike_bench_test.go | 2 +- aerospike_suite_test.go | 6 +- anonymous_fields_test.go | 2 +- base_read_command.go | 2 +- base_write_command.go | 2 +- batch_command.go | 11 +- batch_command_delete.go | 8 +- batch_command_exists.go | 8 +- batch_command_get.go | 10 +- batch_command_get_reflect.go | 2 +- batch_command_operate.go | 16 +- batch_command_reflect.go | 2 +- batch_command_udf.go | 8 +- batch_index_command_get.go | 18 +- batch_node_list.go | 2 +- batch_read.go | 2 +- batch_record.go | 2 +- batch_test.go | 18 +- batch_write.go | 2 +- bench_batchget_test.go | 2 +- bench_cdt_list_test.go | 2 +- bench_get_test.go | 2 +- bench_key_test.go | 6 +- bench_rand_gen_test.go | 2 +- bench_recordset_test.go | 2 +- buffered_connection.go | 4 +- cdt_bitwise_test.go | 16 +- cdt_context.go | 2 +- cdt_context_test.go | 2 +- cdt_list.go | 1 - cdt_list_test.go | 170 +++++++++--------- cdt_map_test.go | 70 ++++---- client.go | 21 +-- client_appengine_exclusions.go | 4 +- client_builder.go | 26 --- client_builder_native.go | 34 ---- client_ifc.go | 146 --------------- client_ifc_app_engine.go | 141 --------------- client_ifc_app_engine_perf.go | 139 -------------- client_ifc_as_performance.go | 141 --------------- client_object_test.go | 2 +- client_reflect.go | 2 +- client_reflect_test.go | 2 +- client_test.go | 8 +- cluster.go | 10 +- command.go | 25 +-- complex_index_test.go | 2 +- complex_query_test.go | 2 +- connection.go | 6 +- delete_command.go | 2 +- docs/README.md | 2 +- docs/aerospike.md | 4 +- docs/client.md | 8 +- docs/datamodel.md | 14 +- docs/log.md | 2 +- error.go | 39 ++-- error_test.go | 2 +- example_client_test.go | 2 +- example_listiter_int_test.go | 2 +- example_listiter_string_test.go | 2 +- example_listiter_time_test.go | 2 +- example_mapiter_test.go | 2 +- example_pagination_cursor_test.go | 2 +- examples/add/add.go | 4 +- examples/append/append.go | 4 +- examples/batch/batch.go | 6 +- examples/blob/blob.go | 2 +- .../count_set_objects_using_request_info.go | 4 +- examples/custom_list_iter/custom_list_iter.go | 4 +- examples/expire/expire.go | 6 +- examples/expressions/expressions.go | 4 +- examples/generation/generation.go | 6 +- examples/geojson_query/geojson_query.go | 4 +- examples/get/get.go | 2 +- examples/info/info.go | 2 +- examples/list_map/list_map.go | 4 +- examples/operate/operate.go | 4 +- examples/prepend/prepend.go | 4 +- examples/put/put.go | 2 +- examples/putget/putget.go | 4 +- examples/query-aggregate/average/average.go | 4 +- .../single_bin_sum/single_bin_sum.go | 4 +- examples/replace/replace.go | 6 +- examples/scan_paginate/scan_paginate.go | 4 +- examples/scan_parallel/scan_parallel.go | 4 +- examples/scan_serial/scan_serial.go | 4 +- examples/shared/shared.go | 2 +- examples/simple/simple.go | 2 +- .../tls_secure_connection.go | 2 +- examples/touch/touch.go | 4 +- examples/udf/udf.go | 4 +- execute_command.go | 8 +- execute_task.go | 2 +- exists_command.go | 2 +- exp_bit_test.go | 2 +- exp_hll_test.go | 2 +- exp_list.go | 2 +- exp_list_test.go | 2 +- exp_map.go | 2 +- exp_map_test.go | 2 +- exp_ops_test.go | 4 +- expression.go | 5 +- expression_ops_test.go | 22 +-- expression_test.go | 4 +- filter.go | 2 +- geo_test.go | 2 +- go.mod | 38 ++-- go.sum | 100 ++++------- hll_operation.go | 2 +- hll_operation_test.go | 48 ++--- host.go | 2 +- host_test.go | 2 +- index_test.go | 2 +- info.go | 4 +- internal/atomic/bool_test.go | 2 +- internal/atomic/guard_test.go | 2 +- internal/atomic/int_test.go | 2 +- internal/atomic/queue_test.go | 2 +- internal/atomic/typed_val_test.go | 2 +- internal/lua/instance.go | 6 +- internal/lua/lua_aerospike.go | 2 +- internal/lua/lua_aerospike_test.go | 2 +- internal/lua/lua_list_test.go | 2 +- internal/lua/lua_map_test.go | 2 +- key.go | 4 +- key_bench_test.go | 2 +- key_helper.go | 8 +- key_test.go | 2 +- load_test.go | 2 +- login_command.go | 6 +- metrics_policy.go | 2 +- multi_command.go | 4 +- node.go | 6 +- node_stats.go | 5 +- node_test.go | 2 +- node_validator.go | 4 +- operate_command_read.go | 3 +- operate_command_write.go | 12 +- packer.go | 6 +- packer_reflect.go | 2 +- partition.go | 2 +- partition_filter.go | 2 +- partition_parser.go | 4 +- partition_tracker.go | 14 +- partitions.go | 2 +- peers.go | 2 +- peers_parser.go | 4 +- query_aggregate_command.go | 4 +- query_aggregate_test.go | 2 +- query_context_test.go | 2 +- query_objects_executor.go | 2 +- query_test.go | 4 +- random_operation_test.go | 2 +- read_command.go | 9 +- read_command_reflect.go | 4 +- read_header_command.go | 2 +- record_parser.go | 19 +- recordset.go | 2 +- recordset_test.go | 2 +- scan_objects_executor.go | 2 +- scan_partition_command.go | 2 +- scan_partition_objects_command.go | 2 +- scan_test.go | 6 +- security_test.go | 2 +- server_command.go | 4 +- single_command.go | 2 +- statement.go | 2 +- task.go | 4 +- tools/asinfo/asinfo.go | 2 +- tools/benchmark/benchmark.go | 19 +- tools/cli/cli.go | 4 +- touch_command.go | 2 +- truncate_test.go | 2 +- txn.go | 4 +- txn_add_keys_command.go | 2 +- txn_close.go | 2 +- txn_error.go | 2 +- txn_mark_roll_forward.go | 2 +- txn_roll.go | 2 +- txn_roll_batch.go | 8 +- txn_roll_batch_single.go | 2 +- txn_test.go | 4 +- txn_verify_batch.go | 8 +- txn_verify_batch_single.go | 6 +- types/histogram/bench_histogram_test.go | 2 +- types/histogram/histogram_test.go | 2 +- types/pool.go | 2 +- udf_test.go | 2 +- unpacker.go | 6 +- value.go | 7 +- value_test.go | 4 +- werrgroup.go | 2 +- write_command.go | 2 +- write_payload_command.go | 4 +- 204 files changed, 614 insertions(+), 1522 deletions(-) delete mode 100644 .travis.yml delete mode 100644 .travis/aerospike.conf delete mode 100755 .travis/proxy_check.sh delete mode 100755 .travis/wait_for_node.sh delete mode 100644 client_builder.go delete mode 100644 client_builder_native.go delete mode 100644 client_ifc.go delete mode 100644 client_ifc_app_engine.go delete mode 100644 client_ifc_app_engine_perf.go delete mode 100644 client_ifc_as_performance.go diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb1436e4..4298ed94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,9 +11,7 @@ jobs: strategy: matrix: go-version: - - "1.20" - - "1.21" - - "1.22" + - "1.23" steps: - uses: actions/checkout@v3 - name: "Setup Go ${{ matrix.go-version }}" @@ -43,8 +41,6 @@ jobs: run: go run github.com/onsi/ginkgo/v2/ginkgo build -tags="as_performance" . - name: Build for Google App Engine (unsafe package removed) run: go run github.com/onsi/ginkgo/v2/ginkgo build -tags="app_engine" . - - name: Build for DBAAS (proxy mode) - run: go run github.com/onsi/ginkgo/v2/ginkgo build -tags="as_proxy" . - name: Run the tests run: go run github.com/onsi/ginkgo/v2/ginkgo -coverprofile=./cover_native.out -covermode=atomic -coverpkg=./... -race -keep-going -succinct -randomize-suites -skip="HyperLogLog" - name: Combine Cover Profiles diff --git a/.testcoverage.yml b/.testcoverage.yml index 5d2da411..0bfdc732 100644 --- a/.testcoverage.yml +++ b/.testcoverage.yml @@ -9,7 +9,7 @@ profile: cover_all.out # (optional; but recommended to set) # When specified reported file paths will not contain local prefix in the output -local-prefix: "github.com/aerospike/aerospike-client-go/v7" +local-prefix: "github.com/aerospike/aerospike-client-go/v8" # Holds coverage thresholds percentages, values should be in range [0-100] threshold: @@ -55,11 +55,6 @@ exclude: - record_exists_action.go - replica_policy.go - generics.go - - proxy_auth_interceptor.go - - proxy_client.go - - proxy_client_reflect.go - - proxy_query_partition_command.go - - proxy_scan_command.go - login_command.go - types/histogram/histogram.go - types/rand/xor_shift128.go diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 37cb70d4..00000000 --- a/.travis.yml +++ /dev/null @@ -1,75 +0,0 @@ -language: go -os: -- linux -dist: xenial -go: -- "1.13" -- "1.14" -- "1.15" -- "1.16" -- tip -matrix: - allow_failures: - - go: tip -install: -- ifconfig -- if [ -d "$HOME/gopath/src/github.com/citrusleaf" ]; then mv $HOME/gopath/src/github.com/citrusleaf - $HOME/gopath/src/github.com/aerospike; fi -- export PATH=$PATH:$HOME/gopath/bin -- go get github.com/onsi/ginkgo/ginkgo -- go get github.com/onsi/gomega -- go get . -- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; - fi -- wget -O aerospike-server.tgz http://www.aerospike.com/download/server/latest/artifact/tgz -- tar xvzf aerospike-server.tgz -- cp -f .travis/aerospike.conf ./aerospike-server/share/etc -- cd aerospike-server -- mkdir instance1 -- mkdir instance2 -- ./bin/aerospike init --home instance1 --instance 1 --service-port 3000 -- ./bin/aerospike init --home instance2 --instance 2 --service-port 3010 -- cd instance1 -- sudo ./bin/aerospike start -- ../../.travis/wait_for_node.sh var/log/aerospike.log -- cd ../.. -- pwd -script: -- ginkgo -cover -race -r -keepGoing -succinct -randomizeSuites internal/lua -- ginkgo -cover -race -r -keepGoing -succinct -randomizeSuites types -- ginkgo -cover -race -r -keepGoing -succinct -randomizeSuites pkg -#- find tools -name "*.go" -type f -print0 | xargs -0 -n1 go build -- cd tools/benchmark | go build -o benchmark . -- cd tools/asinfo | go build -o asinfo . -- chmod +x asinfo -- cd tools/cli | go build -o cli . -- find examples -name "*.go" -type f -print0 | xargs -0 -n1 go build -- ginkgo build -tags="as_performance" . -- ginkgo build -tags="app_engine" . -- ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -- -use-replicas -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="as_performance" -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="app_engine" -- cd aerospike-server/instance1 -- sudo ./bin/aerospike stop -- cat /dev/null > var/log/aerospike.log -- sudo ./bin/aerospike start -- ../../.travis/wait_for_node.sh var/log/aerospike.log -- cd ../instance2 -- sudo ./bin/aerospike start -- ../../.travis/wait_for_node.sh var/log/aerospike.log -- cd ../.. -- ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -- -use-replicas -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="as_performance" -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="app_engine" -- .travis/proxy_check.sh -notifications: - hipchat: - rooms: - secure: mGFpOr8JWxK0bYj6wK3ur5+qtsfK+Im1njfPgoQ2b/Sudlii/mr2QiHyQRHtstw7tr79nyoMYgQ1lc53pTxUNAVSI/PkTJTBaDE4ZkyUG5+UW8NgMsC6FYhRfgu0xq+SBNn5a6KbrL8puQq0FH6fjEDYC00QqmN5L/967WCxF8g= - email: - - qe-notices@aerospike.com - - qe-notices-clients@aerospike.com - slack: - secure: FwRNnmQZLVD3ygwu66ujNTsy1rHKFAV01wZJCad+L0r5I54lxFWZxsO0JtRbhFyZ0yb4fhls4dPpczTqQrtlRgUzWW55u2i5T/bkTWxOik8QPJW35n9EvSOMYgiTQs1PQeSYwRmiqn0aDd8Fu1RAvB71nLKeyccYbVMHGyhpAq8= diff --git a/.travis/aerospike.conf b/.travis/aerospike.conf deleted file mode 100644 index f9483ad8..00000000 --- a/.travis/aerospike.conf +++ /dev/null @@ -1,60 +0,0 @@ -# Aerospike database configuration file. - -# This stanza must come first. -service { - user ${user} - group ${group} - run-as-daemon - paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1. - pidfile ${home}/var/run/aerospike.pid -# transaction-queues 8 -# transaction-threads-per-queue 8 - proto-fd-max 10000 - work-directory ${home}/var -} - -logging { - # Log file must be an absolute path. - file ${home}/var/log/aerospike.log { - context any info - } -} - -mod-lua { -# system-path ${home}/share/udf/lua - user-path ${home}/var/udf/lua -} - -network { - service { - address ${service_addr} - port ${service_port} -# reuse-address -# network-interface-name venet0 - } - - heartbeat { - mode multicast - multicast-group ${multicast_addr} - port ${multicast_port} - - interval 150 - timeout 10 - } - - fabric { - port ${fabric_port} - } - - info { - port ${info_port} - } -} - -namespace test { - replication-factor 1 - memory-size 1G - default-ttl 30d # 30 days, use 0 to never expire/evict. - storage-engine memory - allow-ttl-without-nsup true -} diff --git a/.travis/proxy_check.sh b/.travis/proxy_check.sh deleted file mode 100755 index 843745a4..00000000 --- a/.travis/proxy_check.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -./asinfo -p 3000 -v "namespace/test" | grep -q ";client_proxy_complete=0;" -if [ $? -ne 0 ] -then - exit 1 -fi - -./asinfo -p 3010 -v "namespace/test" | grep -q ";client_proxy_complete=0;" -if [ $? -ne 0 ] -then - exit 1 -fi - -exit 0 \ No newline at end of file diff --git a/.travis/wait_for_node.sh b/.travis/wait_for_node.sh deleted file mode 100755 index 71513c45..00000000 --- a/.travis/wait_for_node.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -################################################################################ -# Copyright 2013-2020 Aerospike, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -################################################################################ - -LOG=$1 -if [ ! -f $LOG ]; then - echo "A log file does not exist at $LOG" - exit 1 -fi - -i=0 -while [ $i -le 12 ] -do - sleep 1 - grep -i "there will be cake" $LOG - if [ $? == 0 ]; then - exit 0 - else - i=$(($i + 1)) - echo -n "." - fi -done -echo "the cake is a lie!" -tail -n 1000 $LOG -exit 2 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d169431d..1f8011ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,14 @@ # Change History -## December 12 2024: v7.8.0-beta.1 +## December 13 2024: v8.0.0-beta.1 - Major feature release. + Major breaking release. This release supports Multi-Record Transactions. Please note that this is a beta release and will be subject to breaking changes. + +- **Breaking Changes** + - This release removes the proxy client and associated mock interfaces from the codebase. Maintaining those interfaces was very hard due to multiple build flags which had their own set of of supported API. Since interfaces are implicit, doing that by the user is as easy, or potentially easier outside of the library. + - Operation used to return the result of multiple ops on a single bin wrapped in `[]any`. That would be confusing, since it was not clear if the result was the contents of the bin, or the results of multiple commands. In version 8, the client will wrap those results inside a `as.OpResults` instead of a `[]any`, removing the confusion. + - The client would automatically populate the `stackFrame` field for the `as.AerospikeError`. Since that was an expensive operation, the client now will consult the value of `StackTracesEnabled` variable before doing so. The default is set to `false` of course. + - The client now requires Go v1.23+. Needed to implement iterators later. - **New Features** - [CLIENT-3159] Support writing raw payload to the server. @@ -14,6 +20,7 @@ - **Improvements** - [CLIENT-3214] Support `-use-services-alternate` in test arguments. + - Renamed all `interface{}` to `any`. ## November 29 2024: v7.7.3 diff --git a/README.md b/README.md index c6e6de09..d8802439 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,24 @@ -# Aerospike Go Client v7 +# Aerospike Go Client v8 -[![Aerospike Client Go](https://goreportcard.com/badge/github.com/aerospike/aerospike-client-go/v7)](https://goreportcard.com/report/github.com/aerospike/aerospike-client-go/v7) -[![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go/v7?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v7) -[![Tests](https://github.com/aerospike/aerospike-client-go/actions/workflows/build.yml/badge.svg?branch=v7&event=push)](github.com/aerospike/aerospike-client-go/actions) +[![Aerospike Client Go](https://goreportcard.com/badge/github.com/aerospike/aerospike-client-go/v8)](https://goreportcard.com/report/github.com/aerospike/aerospike-client-go/v8) +[![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go/v8?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v8) +[![Tests](https://github.com/aerospike/aerospike-client-go/actions/workflows/build.yml/badge.svg?branch=v8&event=push)](github.com/aerospike/aerospike-client-go/actions) An Aerospike library for Go. -This library is compatible with Go 1.20+ and supports the following operating systems: Linux, Mac OS X (Windows builds are possible, but untested). +This library is compatible with Go 1.23+ and supports the following operating systems: Linux, Mac OS X (Windows builds are possible, but untested). -Up-to-date documentation is available in the [![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go/v7?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v7). +Up-to-date documentation is available in the [![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go/v8?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v8). You can refer to the test files for idiomatic use cases. Please refer to [`CHANGELOG.md`](CHANGELOG.md) for release notes, or if you encounter breaking changes. -- [Aerospike Go Client v7](#aerospike-go-client-v7) +- [Aerospike Go Client v8](#aerospike-go-client-v8) - [Usage](#usage) - [Prerequisites](#prerequisites) - [Installation](#installation) - - [Some Hints:](#some-hints) + - [Some Tips](#some-tips) - [Performance Tweaking](#performance-tweaking) - [Tests](#tests) - [Examples](#examples) @@ -27,7 +27,6 @@ Please refer to [`CHANGELOG.md`](CHANGELOG.md) for release notes, or if you enco - [API Documentation](#api-documentation) - [Google App Engine](#google-app-engine) - [Reflection, and Object API](#reflection-and-object-api) - - [Proxy Client / DBAAS](#proxy-client--dbaas) - [License](#license) ## Usage @@ -40,7 +39,7 @@ package main import ( "fmt" - aero "github.com/aerospike/aerospike-client-go/v7" + aero "github.com/aerospike/aerospike-client-go/v8" ) // This is only for this example. @@ -63,7 +62,7 @@ func main() { bins := aero.BinMap{ "bin1": 42, "bin2": "An elephant is a mouse with an operating system", - "bin3": []interface{}{"Go", 2009}, + "bin3": []any{"Go", 2009}, } // write the bins @@ -89,12 +88,11 @@ Details about the API are available in the [`docs`](docs) directory. ## Prerequisites -[Go](http://golang.org) version v1.20+ is required. +[Go](http://golang.org) version v1.23+ is required. To install the latest stable version of Go, visit [http://golang.org/dl/](http://golang.org/dl/) - Aerospike Go client implements the wire protocol, and does not depend on the C client. It is goroutine friendly, and works asynchronously. @@ -108,16 +106,14 @@ Supported operating systems: ## Installation 1. Install Go 1.21+ and setup your environment as [Documented](http://golang.org/doc/code.html#GOPATH) here. -2. Get the client in your ```GOPATH``` : ```go get github.com/aerospike/aerospike-client-go/v7``` - - To update the client library: ```go get -u github.com/aerospike/aerospike-client-go/v7``` - -Using [gopkg.in](https://gopkg.in/) is also supported: `go get -u gopkg.in/aerospike/aerospike-client-go.v7` +2. Get the client in your ```GOPATH``` : ```go get github.com/aerospike/aerospike-client-go/v8``` + - To update the client library: ```go get -u github.com/aerospike/aerospike-client-go/v8``` -### Some Hints: +### Some Tips - To run a go program directly: ```go run ``` - to build: ```go build -o ``` -- example: ```go build -tags as_proxy -o benchmark tools/benchmark/benchmark.go``` +- example: ```go build -tags as_performance -o benchmark tools/benchmark/benchmark.go``` ## Performance Tweaking @@ -160,7 +156,7 @@ See the [`tools/benchmark/README.md`](tools/benchmark/README.md) for details. ## API Documentation -A simple API documentation is available in the [`docs`](docs/README.md) directory. The latest up-to-date docs can be found in [![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v7). +A simple API documentation is available in the [`docs`](docs/README.md) directory. The latest up-to-date docs can be found in [![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v8). ## Google App Engine @@ -174,11 +170,6 @@ To build the library for App Engine, build it with the build tag `app_engine`. A To make the library both flexible and fast, we had to integrate the reflection API (methods with `[Get/Put/...]Object` names) tightly in the library. In case you wanted to avoid mixing those API in your app inadvertently, you can use the build tag `as_performance` to remove those APIs from the build. - -## Proxy Client / DBAAS - -To compile the client for the proxy server in our database-as-a-service (dbaas) environment, pass `-tags as_proxy` to the compiler on build. - ## License diff --git a/admin_command.go b/admin_command.go index ca1e7077..348e8c1a 100644 --- a/admin_command.go +++ b/admin_command.go @@ -19,9 +19,9 @@ import ( "fmt" "time" - "github.com/aerospike/aerospike-client-go/v7/pkg/bcrypt" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/pkg/bcrypt" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) const ( diff --git a/aerospike_bench_reflect_test.go b/aerospike_bench_reflect_test.go index 7e96d6a6..9a9f3f5c 100644 --- a/aerospike_bench_reflect_test.go +++ b/aerospike_bench_reflect_test.go @@ -19,7 +19,7 @@ package aerospike_test import ( "runtime" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" "testing" ) diff --git a/aerospike_bench_test.go b/aerospike_bench_test.go index 0374bf9d..7fb680ca 100644 --- a/aerospike_bench_test.go +++ b/aerospike_bench_test.go @@ -17,7 +17,7 @@ package aerospike_test import ( "runtime" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" "testing" ) diff --git a/aerospike_suite_test.go b/aerospike_suite_test.go index 357939d2..31d6bd87 100644 --- a/aerospike_suite_test.go +++ b/aerospike_suite_test.go @@ -30,9 +30,9 @@ import ( "testing" "time" - as "github.com/aerospike/aerospike-client-go/v7" - asl "github.com/aerospike/aerospike-client-go/v7/logger" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + asl "github.com/aerospike/aerospike-client-go/v8/logger" + ast "github.com/aerospike/aerospike-client-go/v8/types" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/anonymous_fields_test.go b/anonymous_fields_test.go index 4b889bb4..4d262927 100644 --- a/anonymous_fields_test.go +++ b/anonymous_fields_test.go @@ -17,7 +17,7 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/base_read_command.go b/base_read_command.go index f55044b6..10753620 100644 --- a/base_read_command.go +++ b/base_read_command.go @@ -17,7 +17,7 @@ package aerospike import ( "reflect" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) type baseReadCommand struct { diff --git a/base_write_command.go b/base_write_command.go index 7a9499e0..c0d78bfc 100644 --- a/base_write_command.go +++ b/base_write_command.go @@ -14,7 +14,7 @@ package aerospike -import "github.com/aerospike/aerospike-client-go/v7/types" +import "github.com/aerospike/aerospike-client-go/v8/types" // guarantee baseWriteCommand implements command interface var _ command = &baseWriteCommand{} diff --git a/batch_command.go b/batch_command.go index 17775591..3ad301dd 100644 --- a/batch_command.go +++ b/batch_command.go @@ -28,22 +28,15 @@ type batcher interface { generateBatchNodes(*Cluster) ([]*batchNode, Error) setSequence(int, int) - // executeSingle(clientIfc) Error + // executeSingle(*Client) Error setInDoubt(batcher) inDoubt() } -type clientIfc interface { - ClientIfc - - operate(*WritePolicy, *Key, bool, ...*Operation) (*Record, Error) - execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (*Record, Error) -} - type batchCommand struct { baseMultiCommand - client clientIfc + client *Client batch *batchNode policy *BatchPolicy sequenceAP int diff --git a/batch_command_delete.go b/batch_command_delete.go index ce6a042b..da04409d 100644 --- a/batch_command_delete.go +++ b/batch_command_delete.go @@ -15,8 +15,8 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type batchCommandDelete struct { @@ -29,7 +29,7 @@ type batchCommandDelete struct { } func newBatchCommandDelete( - client clientIfc, + client *Client, batch *batchNode, policy *BatchPolicy, batchDeletePolicy *BatchDeletePolicy, @@ -174,7 +174,7 @@ func (cmd *batchCommandDelete) commandType() commandType { return ttBatchWrite } -func (cmd *batchCommandDelete) executeSingle(client clientIfc) Error { +func (cmd *batchCommandDelete) executeSingle(client *Client) Error { policy := cmd.batchDeletePolicy.toWritePolicy(cmd.policy) for i, key := range cmd.keys { res, err := client.Operate(policy, key, DeleteOp()) diff --git a/batch_command_exists.go b/batch_command_exists.go index 49a016d7..6774b6aa 100644 --- a/batch_command_exists.go +++ b/batch_command_exists.go @@ -15,8 +15,8 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type batchCommandExists struct { @@ -27,7 +27,7 @@ type batchCommandExists struct { } func newBatchCommandExists( - client clientIfc, + client *Client, batch *batchNode, policy *BatchPolicy, keys []*Key, @@ -129,7 +129,7 @@ func (cmd *batchCommandExists) commandType() commandType { return ttBatchRead } -func (cmd *batchCommandExists) executeSingle(client clientIfc) Error { +func (cmd *batchCommandExists) executeSingle(client *Client) Error { var err Error for _, offset := range cmd.batch.offsets { cmd.existsArray[offset], err = client.Exists(&cmd.policy.BasePolicy, cmd.keys[offset]) diff --git a/batch_command_get.go b/batch_command_get.go index a5a68ba1..dc6db7f4 100644 --- a/batch_command_get.go +++ b/batch_command_get.go @@ -17,8 +17,8 @@ package aerospike import ( "reflect" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type batchCommandGet struct { @@ -55,7 +55,7 @@ var batchObjectParser func( ) Error func newBatchCommandGet( - client clientIfc, + client *Client, batch *batchNode, policy *BatchPolicy, keys []*Key, @@ -228,7 +228,7 @@ func (cmd *batchCommandGet) commandType() commandType { return ttBatchRead } -func (cmd *batchCommandGet) executeSingle(client clientIfc) Error { +func (cmd *batchCommandGet) executeSingle(client *Client) Error { for _, offset := range cmd.batch.offsets { var err Error if len(cmd.ops) > 0 { @@ -238,7 +238,7 @@ func (cmd *batchCommandGet) executeSingle(client clientIfc) Error { return newError(types.PARAMETER_ERROR, "Write operations not allowed in batch read").setNode(cmd.node) } } - cmd.records[offset], err = client.operate(cmd.policy.toWritePolicy(), cmd.keys[offset], true, cmd.ops...) + cmd.records[offset], err = client.Operate(cmd.policy.toWritePolicy(), cmd.keys[offset], cmd.ops...) } else if (cmd.readAttr & _INFO1_NOBINDATA) == _INFO1_NOBINDATA { cmd.records[offset], err = client.GetHeader(&cmd.policy.BasePolicy, cmd.keys[offset]) } else { diff --git a/batch_command_get_reflect.go b/batch_command_get_reflect.go index 7adf1804..515de5b0 100644 --- a/batch_command_get_reflect.go +++ b/batch_command_get_reflect.go @@ -19,7 +19,7 @@ package aerospike import ( "reflect" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) // if this file is included in the build, it will include this method diff --git a/batch_command_operate.go b/batch_command_operate.go index 78bbf33b..01f3d667 100644 --- a/batch_command_operate.go +++ b/batch_command_operate.go @@ -17,8 +17,8 @@ package aerospike import ( "reflect" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type batchCommandOperate struct { @@ -33,7 +33,7 @@ type batchCommandOperate struct { } func newBatchCommandOperate( - client clientIfc, + client *Client, batch *batchNode, policy *BatchPolicy, records []BatchRecordIfc, @@ -132,7 +132,7 @@ func (cmd *batchCommandOperate) parseRecordResults(ifc command, receiveSize int) } // for UDF failures - var msg interface{} + var msg any if rec != nil { msg = rec.Bins["FAILURE"] } @@ -229,7 +229,7 @@ func (cmd *batchCommandOperate) parseRecord(key *Key, opCount int, generation, e return newRecord(cmd.node, key, bins, generation, expiration), nil } -func (cmd *batchCommandOperate) executeSingle(client clientIfc) Error { +func (cmd *batchCommandOperate) executeSingle(client *Client) Error { var res *Record var err Error for _, br := range cmd.records { @@ -246,14 +246,14 @@ func (cmd *batchCommandOperate) executeSingle(client clientIfc) Error { } else if len(ops) == 0 { ops = append(ops, GetOp()) } - res, err = client.operate(cmd.client.getUsableBatchReadPolicy(br.Policy).toWritePolicy(cmd.policy), br.Key, true, ops...) + res, err = client.Operate(cmd.client.getUsableBatchReadPolicy(br.Policy).toWritePolicy(cmd.policy), br.Key, ops...) case *BatchWrite: policy := cmd.client.getUsableBatchWritePolicy(br.Policy).toWritePolicy(cmd.policy) policy.RespondPerEachOp = true - res, err = client.operate(policy, br.Key, true, br.Ops...) + res, err = client.Operate(policy, br.Key, br.Ops...) case *BatchDelete: policy := cmd.client.getUsableBatchDeletePolicy(br.Policy).toWritePolicy(cmd.policy) - res, err = client.operate(policy, br.Key, true, DeleteOp()) + res, err = client.Operate(policy, br.Key, DeleteOp()) case *BatchUDF: policy := cmd.client.getUsableBatchUDFPolicy(br.Policy).toWritePolicy(cmd.policy) policy.RespondPerEachOp = true diff --git a/batch_command_reflect.go b/batch_command_reflect.go index 9ce42a79..ec5b9c8d 100644 --- a/batch_command_reflect.go +++ b/batch_command_reflect.go @@ -19,7 +19,7 @@ package aerospike import ( "reflect" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) // this function will only be set if the performance flag is not passed for build diff --git a/batch_command_udf.go b/batch_command_udf.go index fbe71e0e..7e5a89c1 100644 --- a/batch_command_udf.go +++ b/batch_command_udf.go @@ -15,8 +15,8 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type batchCommandUDF struct { @@ -32,7 +32,7 @@ type batchCommandUDF struct { } func newBatchCommandUDF( - client clientIfc, + client *Client, batch *batchNode, policy *BatchPolicy, batchUDFPolicy *BatchUDFPolicy, @@ -183,7 +183,7 @@ func (cmd *batchCommandUDF) isRead() bool { return !cmd.attr.hasWrite } -func (cmd *batchCommandUDF) executeSingle(client clientIfc) Error { +func (cmd *batchCommandUDF) executeSingle(client *Client) Error { for i, key := range cmd.keys { policy := cmd.batchUDFPolicy.toWritePolicy(cmd.policy) policy.RespondPerEachOp = true diff --git a/batch_index_command_get.go b/batch_index_command_get.go index 97624a7a..e949b7b1 100644 --- a/batch_index_command_get.go +++ b/batch_index_command_get.go @@ -15,15 +15,17 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) type batchIndexCommandGet struct { batchCommandOperate + + indexRecords []*BatchRead } func newBatchIndexCommandGet( - client clientIfc, + client *Client, batch *batchNode, policy *BatchPolicy, records []*BatchRead, @@ -36,6 +38,7 @@ func newBatchIndexCommandGet( res := batchIndexCommandGet{ batchCommandOperate: newBatchCommandOperate(client, batch, policy, recIfcs), + indexRecords: records, } res.txn = policy.Txn return res @@ -56,9 +59,8 @@ func (cmd *batchIndexCommandGet) Execute() Error { return cmd.execute(cmd) } -func (cmd *batchIndexCommandGet) executeSingle(client clientIfc) Error { - for _, br := range cmd.records { - br := br.(*BatchRead) +func (cmd *batchIndexCommandGet) executeSingle(client *Client) Error { + for _, br := range cmd.indexRecords { var ops []*Operation if br.headerOnly() { ops = []*Operation{GetHeaderOp()} @@ -66,10 +68,12 @@ func (cmd *batchIndexCommandGet) executeSingle(client clientIfc) Error { for i := range br.BinNames { ops = append(ops, GetBinOp(br.BinNames[i])) } - } else { + } else if len(br.Ops) > 0 { ops = br.Ops + } else { + ops = []*Operation{GetOp()} } - res, err := client.operate(cmd.policy.toWritePolicy(), br.Key, true, ops...) + res, err := client.Operate(cmd.policy.toWritePolicy(), br.Key, ops...) br.setRecord(res) if err != nil { br.setRawError(err) diff --git a/batch_node_list.go b/batch_node_list.go index 87e82d8e..01fe7f82 100644 --- a/batch_node_list.go +++ b/batch_node_list.go @@ -14,7 +14,7 @@ package aerospike -import "github.com/aerospike/aerospike-client-go/v7/types" +import "github.com/aerospike/aerospike-client-go/v8/types" func newBatchNodeList(cluster *Cluster, policy *BatchPolicy, keys []*Key, records []*BatchRecord, hasWrite bool) ([]*batchNode, Error) { nodes := cluster.GetNodes() diff --git a/batch_read.go b/batch_read.go index aac921f7..f638f87e 100644 --- a/batch_read.go +++ b/batch_read.go @@ -17,7 +17,7 @@ package aerospike import ( "fmt" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // BatchRead specifies the Key and bin names used in batch read commands diff --git a/batch_record.go b/batch_record.go index d178e880..42315b80 100644 --- a/batch_record.go +++ b/batch_record.go @@ -17,7 +17,7 @@ package aerospike import ( "fmt" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) type batchRecordType byte diff --git a/batch_test.go b/batch_test.go index 39be66fd..b783cdc5 100644 --- a/batch_test.go +++ b/batch_test.go @@ -22,8 +22,8 @@ import ( "strings" "time" - as "github.com/aerospike/aerospike-client-go/v7" - "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + "github.com/aerospike/aerospike-client-go/v8/types" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" @@ -461,17 +461,17 @@ var _ = gg.Describe("Aerospike", func() { op5 := as.ListGetByValueRangeOp(binName, nil, as.NewValue(9), as.ListReturnTypeValue) r, err := client.Operate(wpolicy, key, op1, op2, op3, op4, op5) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins[binName]).To(gm.Equal([]interface{}{[]interface{}{7, 8}, []interface{}{0, 3, 4, 5}, []interface{}{7, 8, 9, 10}, []interface{}{2, 3, 4, 5}, []interface{}{7, 6, 5, 8}})) + gm.Expect(r.Bins[binName]).To(gm.Equal(as.OpResults{[]any{7, 8}, []any{0, 3, 4, 5}, []any{7, 8, 9, 10}, []any{2, 3, 4, 5}, []any{7, 6, 5, 8}})) // Remove op6 := as.ListRemoveByValueRangeOp(binName, as.ListReturnTypeIndex, as.NewValue(7), nil) r2, err2 := client.Operate(wpolicy, key, op6) gm.Expect(err2).ToNot(gm.HaveOccurred()) - gm.Expect(r2.Bins[binName]).To(gm.Equal([]interface{}{0, 3, 4, 5})) + gm.Expect(r2.Bins[binName]).To(gm.Equal([]any{0, 3, 4, 5})) r3, err3 := client.Get(nil, key) gm.Expect(err3).ToNot(gm.HaveOccurred()) - gm.Expect(r3.Bins[binName]).To(gm.Equal([]interface{}{6, 5})) + gm.Expect(r3.Bins[binName]).To(gm.Equal([]any{6, 5})) }) gg.It("must return the result with same ordering", func() { @@ -636,7 +636,7 @@ var _ = gg.Describe("Aerospike", func() { for k := 0; k < keyCount; k++ { key, _ := as.NewKey(ns, set, k) - args := make(map[interface{}]interface{}) + args := make(map[any]any) args["bin1_str"] = "a" batchRecords = append(batchRecords, as.NewBatchUDF( nil, @@ -653,7 +653,7 @@ var _ = gg.Describe("Aerospike", func() { for i := 0; i < keyCount; i++ { gm.Expect(batchRecords[i].BatchRec().Err).To(gm.BeNil()) gm.Expect(batchRecords[i].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[i].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"SUCCESS": map[interface{}]interface{}{"bin1_str": "a"}})) + gm.Expect(batchRecords[i].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"SUCCESS": map[any]any{"bin1_str": "a"}})) } } }) @@ -676,7 +676,7 @@ var _ = gg.Describe("Aerospike", func() { batchRecords := []as.BatchRecordIfc{} key1, _ := as.NewKey(randString(10), set, 1) - args := make(map[interface{}]interface{}) + args := make(map[any]any) args["bin1_str"] = "a" batchRecords = append(batchRecords, as.NewBatchUDF( nil, @@ -895,7 +895,7 @@ var _ = gg.Describe("Aerospike", func() { gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) gm.Expect(rec.ResultCode).To(gm.Equal(types.OK)) gm.Expect(rec.InDoubt).To(gm.BeFalse()) - gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(map[interface{}]interface{}{"status": "OK"})) + gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(map[any]any{"status": "OK"})) } recs, err := client.BatchGet(nil, keys) diff --git a/batch_write.go b/batch_write.go index 88a71695..d94143c3 100644 --- a/batch_write.go +++ b/batch_write.go @@ -14,7 +14,7 @@ package aerospike -import "github.com/aerospike/aerospike-client-go/v7/types" +import "github.com/aerospike/aerospike-client-go/v8/types" var _ BatchRecordIfc = &BatchWrite{} diff --git a/bench_batchget_test.go b/bench_batchget_test.go index 83fbe865..18c97721 100644 --- a/bench_batchget_test.go +++ b/bench_batchget_test.go @@ -22,7 +22,7 @@ import ( _ "net/http/pprof" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) func makeDataForBatchGetBench(set string, bins []*as.Bin) { diff --git a/bench_cdt_list_test.go b/bench_cdt_list_test.go index d231256c..8966c4a5 100644 --- a/bench_cdt_list_test.go +++ b/bench_cdt_list_test.go @@ -21,7 +21,7 @@ import ( // "time" _ "net/http/pprof" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) var list []as.Value diff --git a/bench_get_test.go b/bench_get_test.go index 66f2ca08..883a15be 100644 --- a/bench_get_test.go +++ b/bench_get_test.go @@ -22,7 +22,7 @@ import ( _ "net/http/pprof" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) func makeDataForGetBench(set string, bins []*as.Bin) { diff --git a/bench_key_test.go b/bench_key_test.go index f845ed07..5437d66c 100644 --- a/bench_key_test.go +++ b/bench_key_test.go @@ -18,9 +18,9 @@ import ( "strings" "testing" - as "github.com/aerospike/aerospike-client-go/v7" - "github.com/aerospike/aerospike-client-go/v7/pkg/ripemd160" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + as "github.com/aerospike/aerospike-client-go/v8" + "github.com/aerospike/aerospike-client-go/v8/pkg/ripemd160" + ParticleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" ) var str = strings.Repeat("abcd", 128) diff --git a/bench_rand_gen_test.go b/bench_rand_gen_test.go index 85493b12..3384005a 100644 --- a/bench_rand_gen_test.go +++ b/bench_rand_gen_test.go @@ -19,7 +19,7 @@ import ( "testing" "time" - xor "github.com/aerospike/aerospike-client-go/v7/types/rand" + xor "github.com/aerospike/aerospike-client-go/v8/types/rand" ) func Benchmark_math_rand(b *testing.B) { diff --git a/bench_recordset_test.go b/bench_recordset_test.go index 153a9b3b..3a4a7e4e 100644 --- a/bench_recordset_test.go +++ b/bench_recordset_test.go @@ -21,7 +21,7 @@ import ( // "time" _ "net/http/pprof" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" // _ "github.com/influxdata/influxdb/client" ) diff --git a/buffered_connection.go b/buffered_connection.go index c868b749..0f217a45 100644 --- a/buffered_connection.go +++ b/buffered_connection.go @@ -17,8 +17,8 @@ package aerospike import ( "fmt" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" ) type bufferedConn struct { diff --git a/cdt_bitwise_test.go b/cdt_bitwise_test.go index 9c4ac6c0..5a5547fb 100644 --- a/cdt_bitwise_test.go +++ b/cdt_bitwise_test.go @@ -20,8 +20,8 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + ast "github.com/aerospike/aerospike-client-go/v8/types" ) var _ = gg.Describe("CDT Bitwise Test", func() { @@ -74,7 +74,7 @@ var _ = gg.Describe("CDT Bitwise Test", func() { record, err := client.Operate(nil, key, full_ops...) gm.Expect(err).ToNot(gm.HaveOccurred()) - result_list := record.Bins[cdtBinName].([]interface{}) + result_list := record.Bins[cdtBinName].(as.OpResults) lscan1_result := result_list[len(result_list)-7].(int) rscan1_result := result_list[len(result_list)-6].(int) getint_result := result_list[len(result_list)-5].(int) @@ -109,8 +109,8 @@ var _ = gg.Describe("CDT Bitwise Test", func() { rec, err := client.Operate(wpolicy, key, ops...) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[cdtBinName]).To(gm.BeAssignableToTypeOf([]interface{}{})) - binResults := rec.Bins[cdtBinName].([]interface{}) + gm.Expect(rec.Bins[cdtBinName]).To(gm.BeAssignableToTypeOf(as.OpResults{})) + binResults := rec.Bins[cdtBinName].(as.OpResults) results := make([]int64, len(binResults)) for i := range binResults { results[i] = int64(binResults[i].(int)) @@ -161,7 +161,7 @@ var _ = gg.Describe("CDT Bitwise Test", func() { // // make a fresh list before each operation // gg.BeforeEach(func() { - // list = []interface{}{} + // list = as.OpResults{} // for i := 1; i <= listSize; i++ { // list = append(list, i) @@ -573,7 +573,7 @@ var _ = gg.Describe("CDT Bitwise Test", func() { // assertRecordFound(key, record) - result_list := record.Bins[cdtBinName].([]interface{}) + result_list := record.Bins[cdtBinName].(as.OpResults) results := make([][]byte, len(expected)) for i := 0; i < len(expected); i++ { @@ -948,7 +948,7 @@ var _ = gg.Describe("CDT Bitwise Test", func() { as.BitResizeOp(policy, cdtBinName, 0, as.BitResizeFlagsShrinkOnly), ) gm.Expect(err).ToNot(gm.HaveOccurred()) - result_list := record.Bins[cdtBinName].([]interface{}) + result_list := record.Bins[cdtBinName].(as.OpResults) get0 := result_list[1].([]byte) get1 := result_list[3].([]byte) get2 := result_list[5].([]byte) diff --git a/cdt_context.go b/cdt_context.go index 5f5e1265..9f3c14b6 100644 --- a/cdt_context.go +++ b/cdt_context.go @@ -19,7 +19,7 @@ import ( "encoding/base64" "fmt" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) const ( diff --git a/cdt_context_test.go b/cdt_context_test.go index f3f70092..96095153 100644 --- a/cdt_context_test.go +++ b/cdt_context_test.go @@ -18,7 +18,7 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) var _ = gg.Describe("CDTContext Test", func() { diff --git a/cdt_list.go b/cdt_list.go index 8ab8365a..4cacef39 100644 --- a/cdt_list.go +++ b/cdt_list.go @@ -584,7 +584,6 @@ func ListRemoveByValueListOp(binName string, values []interface{}, returnType Li // If valueEnd is nil, the range is greater than equal to valueBegin. // Server returns removed data specified by returnType func ListRemoveByValueRangeOp(binName string, returnType ListReturnType, valueBegin, valueEnd interface{}, ctx ...*CDTContext) *Operation { - // TODO: Inconsistent parameter order if valueEnd == nil { return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_INTERVAL, IntegerValue(returnType), NewValue(valueBegin)}, encoder: listGenericOpEncoder} } diff --git a/cdt_list_test.go b/cdt_list_test.go index 8a9a1611..e41cc526 100644 --- a/cdt_list_test.go +++ b/cdt_list_test.go @@ -21,7 +21,7 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) var _ = gg.Describe("CDT List Test", func() { @@ -32,7 +32,7 @@ var _ = gg.Describe("CDT List Test", func() { var key *as.Key var wpolicy = as.NewWritePolicy(0, 0) var cdtBinName string - var list []interface{} + var list []any gg.BeforeEach(func() { @@ -52,7 +52,7 @@ var _ = gg.Describe("CDT List Test", func() { gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) gm.Expect(cdtList).To(gm.BeNil()) - list := []interface{}{} + list := []any{} for i := 1; i <= 100; i++ { list = append(list, i) @@ -84,7 +84,7 @@ var _ = gg.Describe("CDT List Test", func() { gm.Expect(err).ToNot(gm.HaveOccurred()) gm.Expect(cdtList).ToNot(gm.BeNil()) gm.Expect(cdtList.Bins).ToNot(gm.BeNil()) - gm.Expect(cdtList.Bins[cdtBinName]).To(gm.Equal([]interface{}{4, []interface{}{1, 2, 3, 4}})) + gm.Expect(cdtList.Bins[cdtBinName]).To(gm.Equal(as.OpResults{4, []any{1, 2, 3, 4}})) }) gg.Describe("CDT List Operations", func() { @@ -96,7 +96,7 @@ var _ = gg.Describe("CDT List Test", func() { _, err = client.Delete(nil, key) gm.Expect(err).ToNot(gm.HaveOccurred()) - list = []interface{}{} + list = []any{} for i := 1; i <= listSize; i++ { list = append(list, i) @@ -127,31 +127,31 @@ var _ = gg.Describe("CDT List Test", func() { gg.It("should Get the last 3 element", func() { cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, -3, 3)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{listSize - 2, listSize - 1, listSize - 0})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{listSize - 2, listSize - 1, listSize - 0})) }) gg.It("should Get the from element #7 till the end of list", func() { cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 7)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{listSize - 2, listSize - 1, listSize - 0})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{listSize - 2, listSize - 1, listSize - 0})) }) gg.It("should Get by value", func() { cdtListRes, err := client.Operate(wpolicy, key, as.ListGetByValueOp(cdtBinName, 7, as.ListReturnTypeValue)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{7})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{7})) - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueListOp(cdtBinName, []interface{}{7, 9}, as.ListReturnTypeIndex)) + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueListOp(cdtBinName, []any{7, 9}, as.ListReturnTypeIndex)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, 8})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{6, 8})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueRangeOp(cdtBinName, 5, 9, as.ListReturnTypeValue)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 6, 7, 8})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{5, 6, 7, 8})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueRangeOp(cdtBinName, 5, 9, as.ListReturnTypeIndex)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{4, 5, 6, 7})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{4, 5, 6, 7})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueRangeOp(cdtBinName, 5, 9, as.ListReturnTypeExists)) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -165,19 +165,19 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeOp(cdtBinName, 7, as.ListReturnTypeIndex)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{7, 8, 9})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{7, 8, 9})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeOp(cdtBinName, 7, as.ListReturnTypeValue)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{8, 9, 10})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeOp(cdtBinName, 8, as.ListReturnTypeValue)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{9, 10})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeCountOp(cdtBinName, 5, 2, as.ListReturnTypeValue)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, 7})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{6, 7})) }) gg.It("should Get by rank", func() { @@ -187,19 +187,19 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeOp(cdtBinName, 7, as.ListReturnTypeIndex)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{7, 8, 9})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{7, 8, 9})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeOp(cdtBinName, 7, as.ListReturnTypeValue)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{8, 9, 10})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeOp(cdtBinName, 8, as.ListReturnTypeValue)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{9, 10})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeCountOp(cdtBinName, 5, 2, as.ListReturnTypeValue)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, 7})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{6, 7})) }) gg.It("should append an element to the tail", func() { @@ -232,7 +232,7 @@ var _ = gg.Describe("CDT List Test", func() { }) gg.It("should append a few elements to the tail", func() { - elems := []interface{}{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} + elems := []any{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} cdtListRes, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, elems...)) gm.Expect(err).ToNot(gm.HaveOccurred()) gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) @@ -243,7 +243,7 @@ var _ = gg.Describe("CDT List Test", func() { }) gg.It("should append a few elements to the tail with policy", func() { - elems := []interface{}{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} + elems := []any{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} cdtListRes, err := client.Operate(wpolicy, key, as.ListAppendWithPolicyOp(as.DefaultListPolicy(), cdtBinName, elems...)) gm.Expect(err).ToNot(gm.HaveOccurred()) gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) @@ -279,11 +279,11 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{math.MaxInt64 - 1, math.MaxInt64 - 2, math.MaxInt64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{math.MaxInt64 - 1, math.MaxInt64 - 2, math.MaxInt64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) }) gg.It("should prepend a few elements to the tail via ListInsertOp", func() { - elems := []interface{}{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} + elems := []any{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} cdtListRes, err := client.Operate(wpolicy, key, as.ListInsertOp(cdtBinName, 0, elems...)) gm.Expect(err).ToNot(gm.HaveOccurred()) gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) @@ -387,13 +387,13 @@ var _ = gg.Describe("CDT List Test", func() { }) gg.It("should remove elements by value", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveByValueListOp(cdtBinName, []interface{}{1, 2, 3, 4, 5, 6, 7}, as.ListReturnTypeValue)) + cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveByValueListOp(cdtBinName, []any{1, 2, 3, 4, 5, 6, 7}, as.ListReturnTypeValue)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{1, 2, 3, 4, 5, 6, 7})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{1, 2, 3, 4, 5, 6, 7})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{8, 9, 10})) cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByValueOp(cdtBinName, 9, as.ListReturnTypeCount)) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -401,17 +401,17 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{8, 10})) }) gg.It("should remove elements by value range", func() { cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveByValueRangeOp(cdtBinName, as.ListReturnTypeValue, 1, 5)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{1, 2, 3, 4})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{1, 2, 3, 4})) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 6, 7, 8, 9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{5, 6, 7, 8, 9, 10})) cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByValueRangeOp(cdtBinName, as.ListReturnTypeCount, 6, 9)) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -419,7 +419,7 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{5, 9, 10})) }) gg.It("should remove elements by index", func() { @@ -429,7 +429,7 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6, 7, 8, 9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{2, 3, 4, 5, 6, 7, 8, 9, 10})) cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByIndexRangeOp(cdtBinName, 5, as.ListReturnTypeCount)) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -437,7 +437,7 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{2, 3, 4, 5, 6})) cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByIndexRangeCountOp(cdtBinName, 2, 3, as.ListReturnTypeCount)) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -445,7 +445,7 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{2, 3})) }) gg.It("should remove elements by rank", func() { @@ -458,7 +458,7 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6, 7, 8, 9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{2, 3, 4, 5, 6, 7, 8, 9, 10})) cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByRankRangeOp(cdtBinName, 5, as.ListReturnTypeCount)) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -466,7 +466,7 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{2, 3, 4, 5, 6})) cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByRankRangeCountOp(cdtBinName, 2, 3, as.ListReturnTypeCount)) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -474,7 +474,7 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{2, 3})) }) gg.It("should increment elements", func() { @@ -528,18 +528,18 @@ var _ = gg.Describe("CDT List Test", func() { cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{101, 2, 3, 4, 5, 6, 7, 8, 9, 10})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{101, 2, 3, 4, 5, 6, 7, 8, 9, 10})) cdtListRes, err = client.Operate(wpolicy, key, as.ListSortOp(cdtBinName, as.ListSortFlagsDefault)) gm.Expect(err).ToNot(gm.HaveOccurred()) cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6, 7, 8, 9, 10, 101})) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]any{2, 3, 4, 5, 6, 7, 8, 9, 10, 101})) }) gg.It("should set elements", func() { - elems := []interface{}{} + elems := []any{} for i := 0; i < listSize; i++ { cdtListRes, err := client.Operate(wpolicy, key, as.ListSetOp(cdtBinName, i, math.MaxInt64)) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -564,7 +564,7 @@ var _ = gg.Describe("CDT List Test", func() { }) gg.It("should trim list elements", func() { - elems := []interface{}{3, 4, 5} + elems := []any{3, 4, 5} cdtListRes, err := client.Operate(wpolicy, key, as.ListTrimOp(cdtBinName, 2, 3)) gm.Expect(err).ToNot(gm.HaveOccurred()) gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(7)) @@ -601,7 +601,7 @@ var _ = gg.Describe("CDT List Test", func() { cdtBinName2 := cdtBinName + "2" - list := []interface{}{0, 4, 5, 9, 9, 11, 15, 0} + list := []any{0, 4, 5, 9, 9, 11, 15, 0} cdtListPolicy1 := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsAddUnique|as.ListWriteFlagsPartial|as.ListWriteFlagsNoFail) cdtListPolicy2 := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsAddUnique|as.ListWriteFlagsNoFail) @@ -614,7 +614,7 @@ var _ = gg.Describe("CDT List Test", func() { gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(6)) gm.Expect(record.Bins[cdtBinName2]).To(gm.Equal(0)) - list = []interface{}{11, 3} + list = []any{11, 3} record, err = client.Operate(wpolicy, key, as.ListAppendWithPolicyOp(cdtListPolicy1, cdtBinName, list...), @@ -630,7 +630,7 @@ var _ = gg.Describe("CDT List Test", func() { gg.It("should support Relative GetList Ops", func() { client.Delete(nil, key) - list := []interface{}{0, 4, 5, 9, 11, 15} + list := []any{0, 4, 5, 9, 11, 15} cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) record, err := client.Operate(wpolicy, key, @@ -650,13 +650,13 @@ var _ = gg.Describe("CDT List Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, []interface{}{5, 9, 11, 15}, []interface{}{9, 11, 15}, []interface{}{4, 5, 9, 11, 15}, []interface{}{4, 5, 9, 11, 15}, []interface{}{11, 15}, []interface{}{0, 4, 5, 9, 11, 15}, []interface{}{5, 9}, []interface{}{9}, []interface{}{4, 5}, []interface{}{4}, []interface{}{11, 15}, []interface{}{}})) + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(as.OpResults{6, []any{5, 9, 11, 15}, []any{9, 11, 15}, []any{4, 5, 9, 11, 15}, []any{4, 5, 9, 11, 15}, []any{11, 15}, []any{0, 4, 5, 9, 11, 15}, []any{5, 9}, []any{9}, []any{4, 5}, []any{4}, []any{11, 15}, []any{}})) }) gg.It("should support Relative RemoveList Ops", func() { client.Delete(nil, key) - list := []interface{}{0, 4, 5, 9, 11, 15} + list := []any{0, 4, 5, 9, 11, 15} cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) record, err := client.Operate(wpolicy, key, @@ -670,13 +670,13 @@ var _ = gg.Describe("CDT List Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, []interface{}{5, 9, 11, 15}, []interface{}{}, []interface{}{4}, []interface{}{}, []interface{}{}, []interface{}{0}})) + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(as.OpResults{6, []any{5, 9, 11, 15}, []any{}, []any{4}, []any{}, []any{}, []any{0}})) }) gg.It("should support List Infinity Ops", func() { client.Delete(nil, key) - list := []interface{}{0, 4, 5, 9, 11, 15} + list := []any{0, 4, 5, 9, 11, 15} cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) record, err := client.Operate(wpolicy, key, @@ -685,34 +685,34 @@ var _ = gg.Describe("CDT List Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, []interface{}{11, 15}})) + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(as.OpResults{6, []any{11, 15}})) }) gg.It("should support List WildCard Ops", func() { client.Delete(nil, key) - list := []interface{}{ - []interface{}{"John", 55}, - []interface{}{"Jim", 95}, - []interface{}{"Joe", 80}, + list := []any{ + []any{"John", 55}, + []any{"Jim", 95}, + []any{"Joe", 80}, } cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) record, err := client.Operate(wpolicy, key, as.ListAppendWithPolicyOp(cdtListPolicy, cdtBinName, list...), - as.ListGetByValueOp(cdtBinName, []interface{}{"Jim", as.NewWildCardValue()}, as.ListReturnTypeValue), + as.ListGetByValueOp(cdtBinName, []any{"Jim", as.NewWildCardValue()}, as.ListReturnTypeValue), ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{3, []interface{}{[]interface{}{"Jim", 95}}})) + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(as.OpResults{3, []any{[]any{"Jim", 95}}})) }) gg.It("should support Nested List Ops", func() { client.Delete(nil, key) - list := []interface{}{ - []interface{}{7, 9, 5}, - []interface{}{1, 2, 3}, - []interface{}{6, 5, 4, 1}, + list := []any{ + []any{7, 9, 5}, + []any{1, 2, 3}, + []any{6, 5, 4, 1}, } err := client.Put(wpolicy, key, as.BinMap{cdtBinName: list}) @@ -725,12 +725,12 @@ var _ = gg.Describe("CDT List Test", func() { record, err = client.Operate(wpolicy, key, as.ListAppendWithPolicyContextOp(as.DefaultListPolicy(), cdtBinName, []*as.CDTContext{as.CtxListIndex(-1)}, 11), as.GetBinOp(cdtBinName)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(as.OpResults{ 5, - []interface{}{ - []interface{}{7, 9, 5}, - []interface{}{1, 2, 3}, - []interface{}{6, 5, 4, 1, 11}, + []any{ + []any{7, 9, 5}, + []any{1, 2, 3}, + []any{6, 5, 4, 1, 11}, }, })) }) @@ -738,15 +738,15 @@ var _ = gg.Describe("CDT List Test", func() { gg.It("should support Nested List Map Ops", func() { client.Delete(nil, key) - m := map[interface{}]interface{}{ - "key1": []interface{}{ - []interface{}{7, 9, 5}, - []interface{}{13}, + m := map[any]any{ + "key1": []any{ + []any{7, 9, 5}, + []any{13}, }, - "key2": []interface{}{ - []interface{}{9}, - []interface{}{2, 4}, - []interface{}{6, 1, 9}, + "key2": []any{ + []any{9}, + []any{2, 4}, + []any{6, 1, 9}, }, } @@ -760,17 +760,17 @@ var _ = gg.Describe("CDT List Test", func() { record, err = client.Operate(wpolicy, key, as.ListAppendWithPolicyContextOp(as.DefaultListPolicy(), cdtBinName, []*as.CDTContext{as.CtxMapKey(as.StringValue("key2")), as.CtxListRank(0)}, 11), as.GetBinOp(cdtBinName)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(as.OpResults{ 3, - map[interface{}]interface{}{ - "key1": []interface{}{ - []interface{}{7, 9, 5}, - []interface{}{13}, + map[any]any{ + "key1": []any{ + []any{7, 9, 5}, + []any{13}, }, - "key2": []interface{}{ - []interface{}{9}, - []interface{}{2, 4, 11}, - []interface{}{6, 1, 9}, + "key2": []any{ + []any{9}, + []any{2, 4, 11}, + []any{6, 1, 9}, }, }})) }) @@ -781,7 +781,7 @@ var _ = gg.Describe("CDT List Test", func() { l1 := []as.Value{as.IntegerValue(7), as.IntegerValue(9), as.IntegerValue(5)} l2 := []as.Value{as.IntegerValue(1), as.IntegerValue(2), as.IntegerValue(3)} l3 := []as.Value{as.IntegerValue(6), as.IntegerValue(5), as.IntegerValue(4), as.IntegerValue(1)} - inputList := []interface{}{as.ValueArray(l1), as.ValueArray(l2), as.ValueArray(l3)} + inputList := []any{as.ValueArray(l1), as.ValueArray(l2), as.ValueArray(l3)} // Create list. record, err := client.Operate(nil, key, @@ -797,16 +797,16 @@ var _ = gg.Describe("CDT List Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - results := record.Bins[cdtBinName].([]interface{}) + results := record.Bins[cdtBinName].(as.OpResults) count := results[0] gm.Expect(count).To(gm.Equal(1)) - list := results[1].([]interface{}) + list := results[1].([]any) gm.Expect(len(list)).To(gm.Equal(4)) // Test last nested list. - list = list[1].([]interface{}) + list = list[1].([]any) gm.Expect(len(list)).To(gm.Equal(1)) gm.Expect(list[0]).To(gm.Equal(2)) }) diff --git a/cdt_map_test.go b/cdt_map_test.go index 5dd76084..7765ca73 100644 --- a/cdt_map_test.go +++ b/cdt_map_test.go @@ -20,7 +20,7 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) const udfCDTTests = ` @@ -176,7 +176,7 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"bin": []interface{}{[]interface{}{"v1.0", "v1.1"}, []interface{}{"v2.0", "v2.1"}}})) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"bin": as.OpResults{[]interface{}{"v1.0", "v1.1"}, []interface{}{"v2.0", "v2.1"}}})) rec, err = client.Get(nil, key) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -193,7 +193,7 @@ var _ = gg.Describe("CDT Map Test", func() { as.GetBinOp(cdtBinName), ) // gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap).NotTo(gm.Equal([]interface{}{1, 2, 3, 4, 4, 4, map[interface{}]interface{}{1: 1, 2: 2, 3: 3, 4: 4}})) + gm.Expect(cdtMap).NotTo(gm.Equal(as.OpResults{1, 2, 3, 4, 4, 4, map[interface{}]interface{}{1: 1, 2: 2, 3: 3, 4: 4}})) cdtMap, err = client.Get(nil, key, cdtBinName) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -237,7 +237,7 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{3, 4, 4, 4, "my default", "changed", []as.MapPair{{Key: 12, Value: 23}, {Key: 13, Value: "myval2"}}})) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(as.OpResults{3, 4, 4, 4, "my default", "changed", []as.MapPair{{Key: 12, Value: 23}, {Key: 13, Value: "myval2"}}})) cdtMap, err = client.Get(nil, key, cdtBinName) gm.Expect(err).ToNot(gm.HaveOccurred()) @@ -271,7 +271,7 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: 3, "other_bin": []interface{}{nil, "head...tail"}})) // there were two operations for bin `other_bin`, so the results come back in an array + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: 3, "other_bin": as.OpResults{nil, "head...tail"}})) // there were two operations for bin `other_bin`, so the results come back in an array // Should set SendKey == true for a solely read operation without getting PARAMETER_ERROR from the server wpolicy2 := *wpolicy @@ -297,12 +297,12 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[0]).To(gm.Equal(1)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[1]).To(gm.Equal(2)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[2]).To(gm.Equal(3)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[3]).To(gm.Equal(4)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[4]).To(gm.Equal([]as.MapPair{{Key: 3, Value: 2}})) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[5]).To(gm.ConsistOf([]as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}})) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[0]).To(gm.Equal(1)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[1]).To(gm.Equal(2)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[2]).To(gm.Equal(3)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[3]).To(gm.Equal(4)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[4]).To(gm.Equal([]as.MapPair{{Key: 3, Value: 2}})) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[5]).To(gm.ConsistOf([]as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}})) cdtMap, err = client.Operate(wpolicy, key, as.MapSetPolicyOp(as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.UPDATE), cdtBinName), @@ -313,7 +313,7 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{interface{}(nil), 2, []as.MapPair{{Key: 1, Value: 4}}, []as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}}}})) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: as.OpResults{interface{}(nil), 2, []as.MapPair{{Key: 1, Value: 4}}, []as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}}}})) }) @@ -330,12 +330,12 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[0]).To(gm.Equal(1)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[1]).To(gm.Equal(2)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[2]).To(gm.Equal(3)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[3]).To(gm.Equal(4)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[4]).To(gm.Equal([]as.MapPair{{Key: 3, Value: 2}})) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[5]).To(gm.ConsistOf([]as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}})) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[0]).To(gm.Equal(1)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[1]).To(gm.Equal(2)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[2]).To(gm.Equal(3)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[3]).To(gm.Equal(4)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[4]).To(gm.Equal([]as.MapPair{{Key: 3, Value: 2}})) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[5]).To(gm.ConsistOf([]as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}})) cdtMap, err = client.Operate(wpolicy, key, as.MapSetPolicyOp(as.NewMapPolicyWithFlagsAndPersistedIndex(as.MapOrder.KEY_ORDERED, as.MapWriteFlagsDefault), cdtBinName), @@ -346,7 +346,7 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{interface{}(nil), 2, []as.MapPair{{Key: 1, Value: 4}}, []as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}}}})) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: as.OpResults{interface{}(nil), 2, []as.MapPair{{Key: 1, Value: 4}}, []as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}}}})) }) @@ -399,7 +399,7 @@ var _ = gg.Describe("CDT Map Test", func() { gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{ + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: as.OpResults{ []interface{}{"Harry", "Jim"}, []as.MapPair{{Key: "Charlie", Value: 55}, {Key: "John", Value: 81}}, 55, @@ -448,7 +448,7 @@ var _ = gg.Describe("CDT Map Test", func() { gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{ + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: as.OpResults{ []interface{}{"Charlie", "John"}, []as.MapPair{{Key: "Harry", Value: 82}, {Key: "Jim", Value: 98}}, []interface{}{0, 1, 2, 3}, @@ -490,11 +490,11 @@ var _ = gg.Describe("CDT Map Test", func() { gm.Expect(err).ToNot(gm.HaveOccurred()) // gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{7, nil, 98, []interface{}{79, 84}, []interface{}{"Charlie"}}})) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[0]).To(gm.Equal(7)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[1]).To(gm.BeNil()) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[2]).To(gm.Equal(98)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[3]).To(gm.ConsistOf([]interface{}{79, 84})) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[4]).To(gm.Equal([]interface{}{"Charlie"})) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[0]).To(gm.Equal(7)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[1]).To(gm.BeNil()) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[2]).To(gm.Equal(98)) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[3]).To(gm.ConsistOf(as.OpResults{79, 84})) + gm.Expect(cdtMap.Bins[cdtBinName].(as.OpResults)[4]).To(gm.Equal([]interface{}{"Charlie"})) }) }) @@ -522,7 +522,7 @@ var _ = gg.Describe("CDT Map Test", func() { gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{7, 2, 2, 2, 1}})) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: as.OpResults{7, 2, 2, 2, 1}})) }) gg.It("should create a valid CDT Map and then execute Clear operations", func() { @@ -554,7 +554,7 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{nil, 0}})) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: as.OpResults{nil, 0}})) }) gg.It("should create a valid CDT Map and then execute RANK operations", func() { @@ -604,7 +604,7 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{[]interface{}{"p1"}, []interface{}{"p3", "p2", "p4"}}})) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: as.OpResults{[]interface{}{"p1"}, []interface{}{"p3", "p2", "p4"}}})) }) gg.It("should support MapWriteFlagsPartial & MapWriteFlagsNoFail", func() { @@ -754,7 +754,7 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{[]interface{}{5, 9}, []interface{}{9}, []interface{}{4, 5, 9}, []interface{}{9}, []interface{}{0, 4, 5, 9}, []interface{}{5}, []interface{}{9}, []interface{}{4}, []interface{}{9}, []interface{}{0}, []interface{}{17}, []interface{}{10, 15, 17}, []interface{}{17}, []interface{}{10}})) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(as.OpResults{[]interface{}{5, 9}, []interface{}{9}, []interface{}{4, 5, 9}, []interface{}{9}, []interface{}{0, 4, 5, 9}, []interface{}{5}, []interface{}{9}, []interface{}{4}, []interface{}{9}, []interface{}{0}, []interface{}{17}, []interface{}{10, 15, 17}, []interface{}{17}, []interface{}{10}})) }) gg.It("should support Relative MapRemove ops", func() { @@ -787,7 +787,7 @@ var _ = gg.Describe("CDT Map Test", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{[]interface{}{15, 10}, []interface{}{}, []interface{}{2}})) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(as.OpResults{[]interface{}{15, 10}, []interface{}{}, []interface{}{2}})) client.Delete(nil, key) cdtMap, err = client.Operate(wpolicy, key, @@ -801,7 +801,7 @@ var _ = gg.Describe("CDT Map Test", func() { as.MapRemoveByValueRelativeRankRangeCountOp(cdtBinName, 11, -1, 1, as.MapReturnType.VALUE), ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{[]interface{}{17}, []interface{}{10}})) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(as.OpResults{[]interface{}{17}, []interface{}{10}})) }) gg.It("should support Nested Map ops", func() { @@ -826,7 +826,7 @@ var _ = gg.Describe("CDT Map Test", func() { record, err = client.Operate(wpolicy, key, as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, as.StringValue("key21"), as.IntegerValue(11), as.CtxMapKey(as.StringValue("key2"))), as.GetBinOp(cdtBinName)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(as.OpResults{ 2, map[interface{}]interface{}{ "key1": map[interface{}]interface{}{ @@ -861,7 +861,7 @@ var _ = gg.Describe("CDT Map Test", func() { record, err = client.Operate(wpolicy, key, as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, as.StringValue("key121"), as.IntegerValue(11), as.CtxMapKey(as.StringValue("key1")), as.CtxMapRank(-1)), as.GetBinOp(cdtBinName)) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(as.OpResults{ 1, map[interface{}]interface{}{ "key1": map[interface{}]interface{}{ @@ -935,7 +935,7 @@ var _ = gg.Describe("CDT Map Test", func() { gm.Expect(err).ToNot(gm.HaveOccurred()) - results := record.Bins[cdtBinName].([]interface{}) + results := record.Bins[cdtBinName].(as.OpResults) count := results[1] gm.Expect(count).To(gm.Equal(1)) diff --git a/client.go b/client.go index 6452508a..ee94be51 100644 --- a/client.go +++ b/client.go @@ -26,8 +26,8 @@ import ( "strings" "time" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" ) const unreachable = "UNREACHABLE" @@ -910,11 +910,6 @@ func (clnt *Client) BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, // // If the policy is nil, the default relevant policy will be used. func (clnt *Client) Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) { - return clnt.operate(policy, key, false, operations...) -} - -// useOpResults is used in batch single nodes commands and should be true to return the right type for BatchOperate results -func (clnt *Client) operate(policy *WritePolicy, key *Key, useOpResults bool, operations ...*Operation) (*Record, Error) { // TODO: Remove this method in the next major release. policy = clnt.getUsableWritePolicy(policy) args, err := newOperateArgs(clnt.cluster, policy, key, operations) @@ -931,7 +926,7 @@ func (clnt *Client) operate(policy *WritePolicy, key *Key, useOpResults bool, op } } - command, err := newOperateCommandWrite(clnt.cluster, key, args, useOpResults) + command, err := newOperateCommandWrite(clnt.cluster, key, args) if err != nil { return nil, err } @@ -947,7 +942,7 @@ func (clnt *Client) operate(policy *WritePolicy, key *Key, useOpResults bool, op } } - command, err := newOperateCommandRead(clnt.cluster, key, args, useOpResults) + command, err := newOperateCommandRead(clnt.cluster, key, args) if err != nil { return nil, err } @@ -1182,7 +1177,7 @@ func (clnt *Client) ListUDF(policy *BasePolicy) ([]*UDF, Error) { // // This method is only supported by Aerospike 3+ servers. // If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) { +func (clnt *Client) Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (any, Error) { record, err := clnt.execute(policy, key, packageName, functionName, args...) if err != nil { return nil, err @@ -2007,7 +2002,7 @@ func (clnt *Client) DisableMetrics() { } // Stats returns internal statistics regarding the inner state of the client and the cluster. -func (clnt *Client) Stats() (map[string]interface{}, Error) { +func (clnt *Client) Stats() (map[string]any, Error) { resStats := clnt.cluster.statsCopy() clusterStats := *newNodeStats(clnt.cluster.MetricsPolicy()) @@ -2022,7 +2017,7 @@ func (clnt *Client) Stats() (map[string]interface{}, Error) { return nil, newCommonError(err) } - res := map[string]interface{}{} + res := map[string]any{} err = json.Unmarshal(b, &res) if err != nil { return nil, newCommonError(err) @@ -2031,7 +2026,7 @@ func (clnt *Client) Stats() (map[string]interface{}, Error) { res["open-connections"] = clusterStats.ConnectionsOpen.Get() res["total-nodes"] = len(clnt.cluster.GetNodes()) - aggstats := res["cluster-aggregated-stats"].(map[string]interface{}) + aggstats := res["cluster-aggregated-stats"].(map[string]any) aggstats["exceeded-max-retries"] = clnt.cluster.maxRetriesExceededCount.Get() aggstats["exceeded-total-timeout"] = clnt.cluster.totalTimeoutExceededCount.Get() diff --git a/client_appengine_exclusions.go b/client_appengine_exclusions.go index 180445cf..93ba5e14 100644 --- a/client_appengine_exclusions.go +++ b/client_appengine_exclusions.go @@ -22,8 +22,8 @@ import ( "golang.org/x/sync/semaphore" - lualib "github.com/aerospike/aerospike-client-go/v7/internal/lua" - "github.com/aerospike/aerospike-client-go/v7/logger" + lualib "github.com/aerospike/aerospike-client-go/v8/internal/lua" + "github.com/aerospike/aerospike-client-go/v8/logger" lua "github.com/yuin/gopher-lua" ) diff --git a/client_builder.go b/client_builder.go deleted file mode 100644 index 6e34feb1..00000000 --- a/client_builder.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// ClientType determines the type of client to build. -type ClientType int - -const ( - // CTNative means: Create a native client. - CTNative ClientType = iota - - // CTProxy means: Create a proxy client. - CTProxy -) diff --git a/client_builder_native.go b/client_builder_native.go deleted file mode 100644 index 3766f597..00000000 --- a/client_builder_native.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "github.com/aerospike/aerospike-client-go/v7/types" - -// CreateClientWithPolicyAndHost generates a new Client of the specified type -// with the specified ClientPolicy and sets up the cluster using the provided hosts. -// If the policy is nil, the default relevant policy will be used. -func CreateClientWithPolicyAndHost(typ ClientType, policy *ClientPolicy, hosts ...*Host) (ClientIfc, Error) { - if len(hosts) == 0 { - return nil, newError(types.SERVER_NOT_AVAILABLE, "No hosts were provided") - } - - switch typ { - case CTNative: - return NewClientWithPolicyAndHost(policy, hosts...) - case CTProxy: - return nil, newError(types.GRPC_ERROR, "Proxy client mode is not supported anymore.") - } - return nil, newError(types.SERVER_NOT_AVAILABLE, "Invalid client type") -} diff --git a/client_ifc.go b/client_ifc.go deleted file mode 100644 index e9297b35..00000000 --- a/client_ifc.go +++ /dev/null @@ -1,146 +0,0 @@ -//go:build !as_performance && !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// ClientIfc abstracts an Aerospike cluster. -type ClientIfc interface { - Add(policy *WritePolicy, key *Key, binMap BinMap) Error - AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Append(policy *WritePolicy, key *Key, binMap BinMap) Error - AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) - BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) - BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) - BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) - BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error - BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) - BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) - BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error - ChangePassword(policy *AdminPolicy, user string, password string) Error - Close() - Cluster() *Cluster - CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) - CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) - CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error - CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error - Delete(policy *WritePolicy, key *Key) (bool, Error) - DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error - DropRole(policy *AdminPolicy, roleName string) Error - DropUser(policy *AdminPolicy, user string) Error - Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) - ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - Exists(policy *BasePolicy, key *Key) (bool, Error) - Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) - GetHeader(policy *BasePolicy, key *Key) (*Record, Error) - GetNodeNames() []string - GetNodes() []*Node - GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - GrantRoles(policy *AdminPolicy, user string, roles []string) Error - IsConnected() bool - ListUDF(policy *BasePolicy) ([]*UDF, Error) - Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) - Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error - PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - PutPayload(policy *WritePolicy, key *Key, payload []byte) Error - Put(policy *WritePolicy, key *Key, binMap BinMap) Error - PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) - QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) - QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) - QueryRole(policy *AdminPolicy, role string) (*Role, Error) - QueryRoles(policy *AdminPolicy) ([]*Role, Error) - QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) - QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) - RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) - RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) - RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) - RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - RevokeRoles(policy *AdminPolicy, user string, roles []string) Error - ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error - SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error - SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error - Stats() (map[string]interface{}, Error) - String() string - Touch(policy *WritePolicy, key *Key) Error - Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error - WarmUp(count int) (int, Error) - - Commit(*Txn) (CommitStatus, Error) - Abort(*Txn) (AbortStatus, Error) - - BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) - GetObject(policy *BasePolicy, key *Key, obj interface{}) Error - PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) - QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) - QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) - QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) - QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) - ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - - // TODO: Synchronization here for the sake of dynamic config in the future - - getUsablePolicy(*BasePolicy) *BasePolicy - getUsableWritePolicy(*WritePolicy) *WritePolicy - getUsableScanPolicy(*ScanPolicy) *ScanPolicy - getUsableQueryPolicy(*QueryPolicy) *QueryPolicy - getUsableAdminPolicy(*AdminPolicy) *AdminPolicy - getUsableInfoPolicy(*InfoPolicy) *InfoPolicy - - getUsableBatchPolicy(*BatchPolicy) *BatchPolicy - getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy - getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy - getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy - getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy - - GetDefaultPolicy() *BasePolicy - GetDefaultBatchPolicy() *BatchPolicy - GetDefaultBatchWritePolicy() *BatchWritePolicy - GetDefaultBatchDeletePolicy() *BatchDeletePolicy - GetDefaultBatchUDFPolicy() *BatchUDFPolicy - GetDefaultWritePolicy() *WritePolicy - GetDefaultScanPolicy() *ScanPolicy - GetDefaultQueryPolicy() *QueryPolicy - GetDefaultAdminPolicy() *AdminPolicy - GetDefaultInfoPolicy() *InfoPolicy - GetDefaultTxnVerifyPolicy() *TxnVerifyPolicy - GetDefaultTxnRollPolicy() *TxnRollPolicy - - SetDefaultPolicy(*BasePolicy) - SetDefaultBatchPolicy(*BatchPolicy) - SetDefaultBatchWritePolicy(*BatchWritePolicy) - SetDefaultBatchDeletePolicy(*BatchDeletePolicy) - SetDefaultBatchUDFPolicy(*BatchUDFPolicy) - SetDefaultWritePolicy(*WritePolicy) - SetDefaultScanPolicy(*ScanPolicy) - SetDefaultQueryPolicy(*QueryPolicy) - SetDefaultAdminPolicy(*AdminPolicy) - SetDefaultInfoPolicy(*InfoPolicy) - SetDefaultTxnVerifyPolicy(*TxnVerifyPolicy) - SetDefaultTxnRollPolicy(*TxnRollPolicy) -} diff --git a/client_ifc_app_engine.go b/client_ifc_app_engine.go deleted file mode 100644 index 310bb050..00000000 --- a/client_ifc_app_engine.go +++ /dev/null @@ -1,141 +0,0 @@ -//go:build !as_performance && app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// ClientIfc abstracts an Aerospike cluster. -type ClientIfc interface { - Add(policy *WritePolicy, key *Key, binMap BinMap) Error - AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Append(policy *WritePolicy, key *Key, binMap BinMap) Error - AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) - BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) - BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) - BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) - BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error - BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) - BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) - BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error - ChangePassword(policy *AdminPolicy, user string, password string) Error - Close() - Cluster() *Cluster - CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) - CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) - CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error - CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error - Delete(policy *WritePolicy, key *Key) (bool, Error) - DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error - DropRole(policy *AdminPolicy, roleName string) Error - DropUser(policy *AdminPolicy, user string) Error - Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) - ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - Exists(policy *BasePolicy, key *Key) (bool, Error) - Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) - GetHeader(policy *BasePolicy, key *Key) (*Record, Error) - GetNodeNames() []string - GetNodes() []*Node - GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - GrantRoles(policy *AdminPolicy, user string, roles []string) Error - IsConnected() bool - ListUDF(policy *BasePolicy) ([]*UDF, Error) - Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) - Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error - PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Put(policy *WritePolicy, key *Key, binMap BinMap) Error - PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) - QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) - QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) - QueryRole(policy *AdminPolicy, role string) (*Role, Error) - QueryRoles(policy *AdminPolicy) ([]*Role, Error) - QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) - QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) - RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) - RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) - RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) - RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - RevokeRoles(policy *AdminPolicy, user string, roles []string) Error - ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error - SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error - SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error - Stats() (map[string]interface{}, Error) - String() string - Touch(policy *WritePolicy, key *Key) Error - Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error - WarmUp(count int) (int, Error) - - // QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) - - BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) - GetObject(policy *BasePolicy, key *Key, obj interface{}) Error - PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) - QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) - QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) - QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) - ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - - // TODO: Synchronization here for the sake of dynamic config in the future - - getUsablePolicy(*BasePolicy) *BasePolicy - getUsableWritePolicy(*WritePolicy) *WritePolicy - getUsableScanPolicy(*ScanPolicy) *ScanPolicy - getUsableQueryPolicy(*QueryPolicy) *QueryPolicy - getUsableAdminPolicy(*AdminPolicy) *AdminPolicy - getUsableInfoPolicy(*InfoPolicy) *InfoPolicy - - getUsableBatchPolicy(*BatchPolicy) *BatchPolicy - getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy - getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy - getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy - getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy - - GetDefaultPolicy() *BasePolicy - GetDefaultBatchPolicy() *BatchPolicy - GetDefaultBatchReadPolicy() *BatchReadPolicy - GetDefaultBatchWritePolicy() *BatchWritePolicy - GetDefaultBatchDeletePolicy() *BatchDeletePolicy - GetDefaultBatchUDFPolicy() *BatchUDFPolicy - GetDefaultWritePolicy() *WritePolicy - GetDefaultScanPolicy() *ScanPolicy - GetDefaultQueryPolicy() *QueryPolicy - GetDefaultAdminPolicy() *AdminPolicy - GetDefaultInfoPolicy() *InfoPolicy - - SetDefaultPolicy(*BasePolicy) - SetDefaultBatchPolicy(*BatchPolicy) - SetDefaultBatchReadPolicy(*BatchReadPolicy) - SetDefaultBatchWritePolicy(*BatchWritePolicy) - SetDefaultBatchDeletePolicy(*BatchDeletePolicy) - SetDefaultBatchUDFPolicy(*BatchUDFPolicy) - SetDefaultWritePolicy(*WritePolicy) - SetDefaultScanPolicy(*ScanPolicy) - SetDefaultQueryPolicy(*QueryPolicy) - SetDefaultAdminPolicy(*AdminPolicy) - SetDefaultInfoPolicy(*InfoPolicy) -} diff --git a/client_ifc_app_engine_perf.go b/client_ifc_app_engine_perf.go deleted file mode 100644 index e2ccaa8c..00000000 --- a/client_ifc_app_engine_perf.go +++ /dev/null @@ -1,139 +0,0 @@ -//go:build as_performance && app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// ClientIfc abstracts an Aerospike cluster. -type ClientIfc interface { - Add(policy *WritePolicy, key *Key, binMap BinMap) Error - AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Append(policy *WritePolicy, key *Key, binMap BinMap) Error - AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) - BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) - BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) - BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) - BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error - BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) - BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) - BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error - ChangePassword(policy *AdminPolicy, user string, password string) Error - Close() - Cluster() *Cluster - CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) - CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) - CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error - CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error - Delete(policy *WritePolicy, key *Key) (bool, Error) - DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error - DropRole(policy *AdminPolicy, roleName string) Error - DropUser(policy *AdminPolicy, user string) Error - Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) - ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - Exists(policy *BasePolicy, key *Key) (bool, Error) - Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) - GetHeader(policy *BasePolicy, key *Key) (*Record, Error) - GetNodeNames() []string - GetNodes() []*Node - GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - GrantRoles(policy *AdminPolicy, user string, roles []string) Error - IsConnected() bool - ListUDF(policy *BasePolicy) ([]*UDF, Error) - Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) - Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error - PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Put(policy *WritePolicy, key *Key, binMap BinMap) Error - PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) - QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) - QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) - QueryRole(policy *AdminPolicy, role string) (*Role, Error) - QueryRoles(policy *AdminPolicy) ([]*Role, Error) - QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) - QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) - RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) - RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) - RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) - RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - RevokeRoles(policy *AdminPolicy, user string, roles []string) Error - ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error - SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error - SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error - Stats() (map[string]interface{}, Error) - String() string - Touch(policy *WritePolicy, key *Key) Error - Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error - WarmUp(count int) (int, Error) - - // QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) - - // BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) - // GetObject(policy *BasePolicy, key *Key, obj interface{}) Error - // PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) - // QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) - // QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) - // QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) - // ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - // ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - // ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - - // TODO: Synchronization here for the sake of dynamic config in the future - - getUsablePolicy(*BasePolicy) *BasePolicy - getUsableWritePolicy(*WritePolicy) *WritePolicy - getUsableScanPolicy(*ScanPolicy) *ScanPolicy - getUsableQueryPolicy(*QueryPolicy) *QueryPolicy - getUsableAdminPolicy(*AdminPolicy) *AdminPolicy - getUsableInfoPolicy(*InfoPolicy) *InfoPolicy - - getUsableBatchPolicy(*BatchPolicy) *BatchPolicy - getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy - getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy - getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy - getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy - - GetDefaultPolicy() *BasePolicy - GetDefaultBatchPolicy() *BatchPolicy - GetDefaultBatchWritePolicy() *BatchWritePolicy - GetDefaultBatchDeletePolicy() *BatchDeletePolicy - GetDefaultBatchUDFPolicy() *BatchUDFPolicy - GetDefaultWritePolicy() *WritePolicy - GetDefaultScanPolicy() *ScanPolicy - GetDefaultQueryPolicy() *QueryPolicy - GetDefaultAdminPolicy() *AdminPolicy - GetDefaultInfoPolicy() *InfoPolicy - - SetDefaultPolicy(*BasePolicy) - SetDefaultBatchPolicy(*BatchPolicy) - SetDefaultBatchWritePolicy(*BatchWritePolicy) - SetDefaultBatchDeletePolicy(*BatchDeletePolicy) - SetDefaultBatchUDFPolicy(*BatchUDFPolicy) - SetDefaultWritePolicy(*WritePolicy) - SetDefaultScanPolicy(*ScanPolicy) - SetDefaultQueryPolicy(*QueryPolicy) - SetDefaultAdminPolicy(*AdminPolicy) - SetDefaultInfoPolicy(*InfoPolicy) -} diff --git a/client_ifc_as_performance.go b/client_ifc_as_performance.go deleted file mode 100644 index 3e3376b6..00000000 --- a/client_ifc_as_performance.go +++ /dev/null @@ -1,141 +0,0 @@ -//go:build as_performance && !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// ClientIfc abstracts an Aerospike cluster. -type ClientIfc interface { - Add(policy *WritePolicy, key *Key, binMap BinMap) Error - AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Append(policy *WritePolicy, key *Key, binMap BinMap) Error - AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) - BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) - BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) - BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) - BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error - BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) - BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) - BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error - ChangePassword(policy *AdminPolicy, user string, password string) Error - Close() - Cluster() *Cluster - CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) - CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) - CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error - CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error - Delete(policy *WritePolicy, key *Key) (bool, Error) - DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error - DropRole(policy *AdminPolicy, roleName string) Error - DropUser(policy *AdminPolicy, user string) Error - Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) - ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - Exists(policy *BasePolicy, key *Key) (bool, Error) - Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) - GetHeader(policy *BasePolicy, key *Key) (*Record, Error) - GetNodeNames() []string - GetNodes() []*Node - GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - GrantRoles(policy *AdminPolicy, user string, roles []string) Error - IsConnected() bool - ListUDF(policy *BasePolicy) ([]*UDF, Error) - Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) - Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error - PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Put(policy *WritePolicy, key *Key, binMap BinMap) Error - PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) - QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) - QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) - QueryRole(policy *AdminPolicy, role string) (*Role, Error) - QueryRoles(policy *AdminPolicy) ([]*Role, Error) - QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) - QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) - RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) - RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) - RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) - RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - RevokeRoles(policy *AdminPolicy, user string, roles []string) Error - ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error - SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error - SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error - Stats() (map[string]interface{}, Error) - String() string - Touch(policy *WritePolicy, key *Key) Error - Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error - WarmUp(count int) (int, Error) - - QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) - - // BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) - // GetObject(policy *BasePolicy, key *Key, obj interface{}) Error - // PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) - // QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) - // QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) - // QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) - // ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - // ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - // ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - - // TODO: Synchronization here for the sake of dynamic config in the future - - getUsablePolicy(*BasePolicy) *BasePolicy - getUsableWritePolicy(*WritePolicy) *WritePolicy - getUsableScanPolicy(*ScanPolicy) *ScanPolicy - getUsableQueryPolicy(*QueryPolicy) *QueryPolicy - getUsableAdminPolicy(*AdminPolicy) *AdminPolicy - getUsableInfoPolicy(*InfoPolicy) *InfoPolicy - - getUsableBatchPolicy(*BatchPolicy) *BatchPolicy - getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy - getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy - getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy - getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy - - GetDefaultPolicy() *BasePolicy - GetDefaultBatchPolicy() *BatchPolicy - GetDefaultBatchReadPolicy() *BatchReadPolicy - GetDefaultBatchWritePolicy() *BatchWritePolicy - GetDefaultBatchDeletePolicy() *BatchDeletePolicy - GetDefaultBatchUDFPolicy() *BatchUDFPolicy - GetDefaultWritePolicy() *WritePolicy - GetDefaultScanPolicy() *ScanPolicy - GetDefaultQueryPolicy() *QueryPolicy - GetDefaultAdminPolicy() *AdminPolicy - GetDefaultInfoPolicy() *InfoPolicy - - SetDefaultPolicy(*BasePolicy) - SetDefaultBatchPolicy(*BatchPolicy) - SetDefaultBatchReadPolicy(*BatchReadPolicy) - SetDefaultBatchWritePolicy(*BatchWritePolicy) - SetDefaultBatchDeletePolicy(*BatchDeletePolicy) - SetDefaultBatchUDFPolicy(*BatchUDFPolicy) - SetDefaultWritePolicy(*WritePolicy) - SetDefaultScanPolicy(*ScanPolicy) - SetDefaultQueryPolicy(*QueryPolicy) - SetDefaultAdminPolicy(*AdminPolicy) - SetDefaultInfoPolicy(*InfoPolicy) -} diff --git a/client_object_test.go b/client_object_test.go index 4f171313..88a220e5 100644 --- a/client_object_test.go +++ b/client_object_test.go @@ -21,7 +21,7 @@ import ( "strconv" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/client_reflect.go b/client_reflect.go index f800a5eb..aaac279d 100644 --- a/client_reflect.go +++ b/client_reflect.go @@ -19,7 +19,7 @@ package aerospike import ( "reflect" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // PutObject writes record bin(s) to the server. diff --git a/client_reflect_test.go b/client_reflect_test.go index 6fac8087..4e83fdeb 100644 --- a/client_reflect_test.go +++ b/client_reflect_test.go @@ -21,7 +21,7 @@ import ( "math" "strings" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/client_test.go b/client_test.go index 3d6659b6..1d27be91 100644 --- a/client_test.go +++ b/client_test.go @@ -24,10 +24,10 @@ import ( "strings" "time" - as "github.com/aerospike/aerospike-client-go/v7" - "github.com/aerospike/aerospike-client-go/v7/types" - ast "github.com/aerospike/aerospike-client-go/v7/types" - asub "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + as "github.com/aerospike/aerospike-client-go/v8" + "github.com/aerospike/aerospike-client-go/v8/types" + ast "github.com/aerospike/aerospike-client-go/v8/types" + asub "github.com/aerospike/aerospike-client-go/v8/utils/buffer" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/cluster.go b/cluster.go index f4c5a19c..4c70a950 100644 --- a/cluster.go +++ b/cluster.go @@ -24,11 +24,11 @@ import ( "golang.org/x/sync/errgroup" - iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - sm "github.com/aerospike/aerospike-client-go/v7/internal/atomic/map" - "github.com/aerospike/aerospike-client-go/v7/internal/seq" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + iatomic "github.com/aerospike/aerospike-client-go/v8/internal/atomic" + sm "github.com/aerospike/aerospike-client-go/v8/internal/atomic/map" + "github.com/aerospike/aerospike-client-go/v8/internal/seq" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" ) // Cluster encapsulates the aerospike cluster nodes and manages diff --git a/command.go b/command.go index d24fa1ae..18a51773 100644 --- a/command.go +++ b/command.go @@ -22,12 +22,12 @@ import ( "fmt" "time" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" - "github.com/aerospike/aerospike-client-go/v7/types/pool" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" + "github.com/aerospike/aerospike-client-go/v8/types/pool" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + ParticleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) const ( @@ -1078,7 +1078,7 @@ func (cmd *baseCommand) setUdf(policy *WritePolicy, key *Key, packageName string } func (cmd *baseCommand) setBatchOperateIfc( - client ClientIfc, + client *Client, policy *BatchPolicy, records []BatchRecordIfc, batch *batchNode, @@ -1088,7 +1088,7 @@ func (cmd *baseCommand) setBatchOperateIfc( } func (cmd *baseCommand) setBatchOperateIfcOffsets( - client ClientIfc, + client *Client, policy *BatchPolicy, records []BatchRecordIfc, offsets BatchOffsets, @@ -1510,8 +1510,6 @@ func (cmd *baseCommand) setBatchUDFOffsets( } // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - // TODO: Implement canRepeat - // if !attr.sendKey && keyPrev != nil && keyPrev.namespace == key.namespace && (keyPrev.setName == key.setName) { if canRepeatAttr(attr, key, keyPrev, ver, verPrev) { // Can set repeat previous namespace/bin names to save space. cmd.dataOffset++ @@ -2965,7 +2963,6 @@ func (cmd *baseCommand) writeKeyAttr( return nil } -// TODO: Check this with the java client, including the references func (cmd *baseCommand) writeKeyWithPolicy(policy *BasePolicy, key *Key, sendDeadline bool) Error { if err := cmd.writeKey(key); err != nil { return err @@ -3539,14 +3536,6 @@ func (cmd *baseCommand) executeAt(ifc command, policy *BasePolicy, deadline time applyTransactionErrorMetrics(cmd.node) return chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) } - - // TODO: Redundant. Move everything to the prepareBuffer method and remove the branch on top of this block. - // // now that the deadline has been set in the buffer, compress the contents - // if err = cmd.prepareBuffer(ifc, deadline); err != nil { - // applyTransactionErrorMetrics(cmd.node) - // applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) - // return chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node) - // } } // Send command. diff --git a/complex_index_test.go b/complex_index_test.go index 6a4cf7b4..9f159861 100644 --- a/complex_index_test.go +++ b/complex_index_test.go @@ -15,7 +15,7 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/complex_query_test.go b/complex_query_test.go index 7a70e4d1..da9bf0a1 100644 --- a/complex_query_test.go +++ b/complex_query_test.go @@ -15,7 +15,7 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/connection.go b/connection.go index f538ce4e..255f11f9 100644 --- a/connection.go +++ b/connection.go @@ -24,9 +24,9 @@ import ( "sync" "time" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" - "github.com/aerospike/aerospike-client-go/v7/types/histogram" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" + "github.com/aerospike/aerospike-client-go/v8/types/histogram" ) const _BUFF_ADJUST_INTERVAL = 5 * time.Second diff --git a/delete_command.go b/delete_command.go index b4c39bf3..9a80425f 100644 --- a/delete_command.go +++ b/delete_command.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // guarantee deleteCommand implements command interface diff --git a/docs/README.md b/docs/README.md index 10a5f950..e7e59f75 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,7 +8,7 @@ This package describes the Aerospike Go Client API in detail. The aerospike Go client package is the main entry point to the client API. ```go - import as "github.com/aerospike/aerospike-client-go/v7" + import as "github.com/aerospike/aerospike-client-go/v8" ``` Before connecting to a cluster, you must import the package. diff --git a/docs/aerospike.md b/docs/aerospike.md index 00448d7a..47047ccc 100644 --- a/docs/aerospike.md +++ b/docs/aerospike.md @@ -15,7 +15,7 @@ The aerospike package can be imported into your project via: ```go - import as "github.com/aerospike/aerospike-client-go/v7" + import as "github.com/aerospike/aerospike-client-go/v8" ``` @@ -81,7 +81,7 @@ key --> -### NewKey(ns, set string, key interface{}): * +### NewKey(ns, set string, key any): * Creates a new [key object](datamodel.md#key) with the provided arguments. diff --git a/docs/client.md b/docs/client.md index de9a17fa..035b5fb0 100644 --- a/docs/client.md +++ b/docs/client.md @@ -392,7 +392,7 @@ Example: "a": "Lack of skill dictates economy of style.", "b": 123, "c": []int{1, 2, 3}, - "d": map[string]interface{}{"a": 42, "b": "An elephant is mouse with an operating system."}, + "d": map[string]any{"a": 42, "b": "An elephant is mouse with an operating system."}, } err := client.Put(nil, key, bins) @@ -424,7 +424,7 @@ Example: bin1 := NewBin("a", "Lack of skill dictates economy of style.") bin2 := NewBin("b", 123) bin3 := NewBin("c", []int{1, 2, 3}) - bin4 := NewBin("d", map[string]interface{}{"a": 42, "b": "An elephant is mouse with an operating system."}) + bin4 := NewBin("d", map[string]any{"a": 42, "b": "An elephant is mouse with an operating system."}) err := client.PutBins(nil, key, bin1, bin2, bin3, bin4) ``` @@ -647,7 +647,7 @@ execute() --> -### Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, error) +### Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (any, error) Executes a UDF on a record with the given key, and returns the results. @@ -666,7 +666,7 @@ Considering the UDF registered in RegisterUDF example above: ```go res, err := client.Execute(nil, key, "udf1", "testFunc1") - // res will be a: map[interface{}]interface{}{"status": "OK"} + // res will be a: map[any]any{"status": "OK"} ``` -## NewKey(ns, set string, key interface{}) +## NewKey(ns, set string, key any) A record is addressable via its key. A key is a struct containing: @@ -144,7 +144,7 @@ bin --> -## NewBin(name string, value interface{}) Value +## NewBin(name string, value any) Value Bins are analogous to fields in relational databases. @@ -157,7 +157,7 @@ Example: bin1 := NewBin("name", "Aerospike") // string value bin2 := NewBin("maxTPS", 1000000) // number value bin3 := NewBin("notes", - map[interface{}]interface{}{ + map[any]any{ "age": 5, 666: "not allowed in", "clients": []string{"go", "c", "java", "python", "node", "erlang"}, @@ -219,7 +219,7 @@ filter --> -## NewEqualFilter(binName string, value interface{}) *Filter +## NewEqualFilter(binName string, value any) *Filter Create equality filter for query. diff --git a/docs/log.md b/docs/log.md index 2830a31f..e94443fb 100644 --- a/docs/log.md +++ b/docs/log.md @@ -4,7 +4,7 @@ Various log levels available to log from the Aerospike API. Default is set to OFF. ```go - import asl "github.com/aerospike/aerospike-client-go/v7/logger" + import asl "github.com/aerospike/aerospike-client-go/v8/logger" asl.Logger.SetLevel(asl.OFF) ``` diff --git a/error.go b/error.go index 1de81f0a..db265a0c 100644 --- a/error.go +++ b/error.go @@ -21,9 +21,12 @@ import ( "strconv" "strings" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) +// Specifies if stack traces should be included in the error. +var StackTracesEnabled = false + // Error is the internal error interface for the Aerospike client's errors. // All the public API return this error type. This interface is compatible // with error interface, including errors.Is and errors.As. @@ -436,24 +439,26 @@ func (st *stackFrame) String() string { } func stackTrace(err Error) []stackFrame { - const maxDepth = 10 - sFrames := make([]stackFrame, 0, maxDepth) - for i := 3; i <= maxDepth+3; i++ { - pc, fl, ln, ok := runtime.Caller(i) - if !ok { - break - } - fn := runtime.FuncForPC(pc) - sFrame := stackFrame{ - fl: fl, - fn: fn.Name(), - ln: ln, + if StackTracesEnabled { + const maxDepth = 10 + sFrames := make([]stackFrame, 0, maxDepth) + for i := 3; i <= maxDepth+3; i++ { + pc, fl, ln, ok := runtime.Caller(i) + if !ok { + break + } + fn := runtime.FuncForPC(pc) + sFrame := stackFrame{ + fl: fl, + fn: fn.Name(), + ln: ln, + } + sFrames = append(sFrames, sFrame) } - sFrames = append(sFrames, sFrame) - } - if len(sFrames) > 0 { - return sFrames + if len(sFrames) > 0 { + return sFrames + } } return nil } diff --git a/error_test.go b/error_test.go index e541c726..7e4d807d 100644 --- a/error_test.go +++ b/error_test.go @@ -17,7 +17,7 @@ package aerospike import ( "errors" - ast "github.com/aerospike/aerospike-client-go/v7/types" + ast "github.com/aerospike/aerospike-client-go/v8/types" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/example_client_test.go b/example_client_test.go index df884991..bdae322f 100644 --- a/example_client_test.go +++ b/example_client_test.go @@ -21,7 +21,7 @@ import ( "fmt" "log" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) func ExampleClient_Add() { diff --git a/example_listiter_int_test.go b/example_listiter_int_test.go index 13e44515..8363a853 100644 --- a/example_listiter_int_test.go +++ b/example_listiter_int_test.go @@ -18,7 +18,7 @@ import ( "fmt" "log" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) /* diff --git a/example_listiter_string_test.go b/example_listiter_string_test.go index 8d7a4232..a4b21f37 100644 --- a/example_listiter_string_test.go +++ b/example_listiter_string_test.go @@ -18,7 +18,7 @@ import ( "fmt" "log" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) /* diff --git a/example_listiter_time_test.go b/example_listiter_time_test.go index 9fb41538..8d21432c 100644 --- a/example_listiter_time_test.go +++ b/example_listiter_time_test.go @@ -19,7 +19,7 @@ import ( "log" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) /* diff --git a/example_mapiter_test.go b/example_mapiter_test.go index 8da567a5..8bdeeda2 100644 --- a/example_mapiter_test.go +++ b/example_mapiter_test.go @@ -19,7 +19,7 @@ import ( "log" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) /* diff --git a/example_pagination_cursor_test.go b/example_pagination_cursor_test.go index 6da9dac7..88b004f6 100644 --- a/example_pagination_cursor_test.go +++ b/example_pagination_cursor_test.go @@ -18,7 +18,7 @@ import ( "fmt" "log" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) func ExamplePartitionFilter_EncodeCursor() { diff --git a/examples/add/add.go b/examples/add/add.go index a3f561f4..6868d932 100644 --- a/examples/add/add.go +++ b/examples/add/add.go @@ -20,8 +20,8 @@ package main import ( "log" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/append/append.go b/examples/append/append.go index e106bc33..b50bc571 100644 --- a/examples/append/append.go +++ b/examples/append/append.go @@ -20,8 +20,8 @@ package main import ( "log" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/batch/batch.go b/examples/batch/batch.go index 7d875d3e..9ccbf142 100644 --- a/examples/batch/batch.go +++ b/examples/batch/batch.go @@ -21,9 +21,9 @@ import ( "log" "strconv" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" - asl "github.com/aerospike/aerospike-client-go/v7/logger" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" + asl "github.com/aerospike/aerospike-client-go/v8/logger" ) func main() { diff --git a/examples/blob/blob.go b/examples/blob/blob.go index 6f9de262..cf8af577 100644 --- a/examples/blob/blob.go +++ b/examples/blob/blob.go @@ -15,7 +15,7 @@ package main import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) // Person is a custom data type to be converted to a blob diff --git a/examples/count_set_objects/count_set_objects_using_request_info.go b/examples/count_set_objects/count_set_objects_using_request_info.go index f5cb04a8..bc4f019a 100644 --- a/examples/count_set_objects/count_set_objects_using_request_info.go +++ b/examples/count_set_objects/count_set_objects_using_request_info.go @@ -6,8 +6,8 @@ import ( "strconv" "strings" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/custom_list_iter/custom_list_iter.go b/examples/custom_list_iter/custom_list_iter.go index 041d7050..92a95d18 100644 --- a/examples/custom_list_iter/custom_list_iter.go +++ b/examples/custom_list_iter/custom_list_iter.go @@ -22,8 +22,8 @@ import ( "reflect" "time" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) var ( diff --git a/examples/expire/expire.go b/examples/expire/expire.go index 59e70437..4d7137df 100644 --- a/examples/expire/expire.go +++ b/examples/expire/expire.go @@ -22,9 +22,9 @@ import ( "math" "time" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" + ast "github.com/aerospike/aerospike-client-go/v8/types" ) func main() { diff --git a/examples/expressions/expressions.go b/examples/expressions/expressions.go index 4b8a8dee..d9b089c2 100644 --- a/examples/expressions/expressions.go +++ b/examples/expressions/expressions.go @@ -21,8 +21,8 @@ import ( "log" "strings" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/generation/generation.go b/examples/generation/generation.go index fa4f9a14..7b2fa52e 100644 --- a/examples/generation/generation.go +++ b/examples/generation/generation.go @@ -21,9 +21,9 @@ import ( "errors" "log" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" + ast "github.com/aerospike/aerospike-client-go/v8/types" ) func main() { diff --git a/examples/geojson_query/geojson_query.go b/examples/geojson_query/geojson_query.go index 1afece68..4277dfeb 100644 --- a/examples/geojson_query/geojson_query.go +++ b/examples/geojson_query/geojson_query.go @@ -18,8 +18,8 @@ package main import ( "log" - as "github.com/aerospike/aerospike-client-go/v7" - "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/get/get.go b/examples/get/get.go index 4c6847b3..acadc89e 100644 --- a/examples/get/get.go +++ b/examples/get/get.go @@ -20,7 +20,7 @@ import ( "os" "strconv" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) var ( diff --git a/examples/info/info.go b/examples/info/info.go index 8a24b309..55aaf6b7 100644 --- a/examples/info/info.go +++ b/examples/info/info.go @@ -18,7 +18,7 @@ import ( "log" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) func main() { diff --git a/examples/list_map/list_map.go b/examples/list_map/list_map.go index 9ad559ab..fc947aa5 100644 --- a/examples/list_map/list_map.go +++ b/examples/list_map/list_map.go @@ -21,8 +21,8 @@ import ( "bytes" "log" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/operate/operate.go b/examples/operate/operate.go index c180a277..f893d964 100644 --- a/examples/operate/operate.go +++ b/examples/operate/operate.go @@ -20,8 +20,8 @@ package main import ( "log" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/prepend/prepend.go b/examples/prepend/prepend.go index 430d3ce3..1357efb5 100644 --- a/examples/prepend/prepend.go +++ b/examples/prepend/prepend.go @@ -20,8 +20,8 @@ package main import ( "log" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/put/put.go b/examples/put/put.go index ea1a42a1..c1e619e9 100644 --- a/examples/put/put.go +++ b/examples/put/put.go @@ -21,7 +21,7 @@ import ( "os" "strconv" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) var ( diff --git a/examples/putget/putget.go b/examples/putget/putget.go index ede57ee9..fb20144d 100644 --- a/examples/putget/putget.go +++ b/examples/putget/putget.go @@ -22,8 +22,8 @@ import ( "log" "time" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/query-aggregate/average/average.go b/examples/query-aggregate/average/average.go index e5b39060..a190f9d6 100644 --- a/examples/query-aggregate/average/average.go +++ b/examples/query-aggregate/average/average.go @@ -22,8 +22,8 @@ import ( "os" "time" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) const keyCount = 1000 diff --git a/examples/query-aggregate/single_bin_sum/single_bin_sum.go b/examples/query-aggregate/single_bin_sum/single_bin_sum.go index 9099aeb8..dd6a7718 100644 --- a/examples/query-aggregate/single_bin_sum/single_bin_sum.go +++ b/examples/query-aggregate/single_bin_sum/single_bin_sum.go @@ -22,8 +22,8 @@ import ( "os" "time" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) const keyCount = 1000 diff --git a/examples/replace/replace.go b/examples/replace/replace.go index 8966a3ae..a0033e02 100644 --- a/examples/replace/replace.go +++ b/examples/replace/replace.go @@ -21,9 +21,9 @@ import ( "errors" "log" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" + ast "github.com/aerospike/aerospike-client-go/v8/types" ) func main() { diff --git a/examples/scan_paginate/scan_paginate.go b/examples/scan_paginate/scan_paginate.go index d95adeb3..9cf76dba 100644 --- a/examples/scan_paginate/scan_paginate.go +++ b/examples/scan_paginate/scan_paginate.go @@ -21,8 +21,8 @@ import ( "log" "time" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/scan_parallel/scan_parallel.go b/examples/scan_parallel/scan_parallel.go index 3dd36128..843deb60 100644 --- a/examples/scan_parallel/scan_parallel.go +++ b/examples/scan_parallel/scan_parallel.go @@ -21,8 +21,8 @@ import ( "log" "time" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/scan_serial/scan_serial.go b/examples/scan_serial/scan_serial.go index 3f2d0092..e1a1cedb 100644 --- a/examples/scan_serial/scan_serial.go +++ b/examples/scan_serial/scan_serial.go @@ -21,8 +21,8 @@ import ( "log" "time" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/shared/shared.go b/examples/shared/shared.go index 47daa04d..ae7404be 100644 --- a/examples/shared/shared.go +++ b/examples/shared/shared.go @@ -27,7 +27,7 @@ import ( "runtime" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) // WritePolicy is shared for all examples diff --git a/examples/simple/simple.go b/examples/simple/simple.go index 2107840f..e83ec69f 100644 --- a/examples/simple/simple.go +++ b/examples/simple/simple.go @@ -17,7 +17,7 @@ package main import ( "fmt" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) func main() { diff --git a/examples/tls_secure_connection/tls_secure_connection.go b/examples/tls_secure_connection/tls_secure_connection.go index 4cdbb4c6..b65fe166 100644 --- a/examples/tls_secure_connection/tls_secure_connection.go +++ b/examples/tls_secure_connection/tls_secure_connection.go @@ -25,7 +25,7 @@ import ( "os" "path/filepath" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) var host = flag.String("h", "127.0.0.1", "Aerospike server seed hostnames or IP addresses") diff --git a/examples/touch/touch.go b/examples/touch/touch.go index 9b9ab62c..906d1c1c 100644 --- a/examples/touch/touch.go +++ b/examples/touch/touch.go @@ -21,8 +21,8 @@ import ( "log" "time" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) func main() { diff --git a/examples/udf/udf.go b/examples/udf/udf.go index dc0a5115..04df0b6c 100644 --- a/examples/udf/udf.go +++ b/examples/udf/udf.go @@ -21,8 +21,8 @@ import ( "bytes" "log" - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + as "github.com/aerospike/aerospike-client-go/v8" + shared "github.com/aerospike/aerospike-client-go/v8/examples/shared" ) const udf = ` diff --git a/execute_command.go b/execute_command.go index 61da3e32..f270c4b8 100644 --- a/execute_command.go +++ b/execute_command.go @@ -15,8 +15,8 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" ) type executeCommand struct { @@ -70,7 +70,7 @@ func (cmd *executeCommand) parseResult(ifc command, conn *Connection) Error { } else if rp.resultCode == types.FILTERED_OUT { return ErrFilteredOut.err() } else if rp.resultCode == types.UDF_BAD_RESPONSE { - cmd.record, _ = rp.parseRecord(cmd.key, false, false) + cmd.record, _ = rp.parseRecord(cmd.key, false) err := cmd.handleUdfError(rp.resultCode) logger.Logger.Debug("UDF execution error: " + err.Error()) return err @@ -85,7 +85,7 @@ func (cmd *executeCommand) parseResult(ifc command, conn *Connection) Error { return nil } - cmd.record, err = rp.parseRecord(cmd.key, false, false) + cmd.record, err = rp.parseRecord(cmd.key, false) if err != nil { return err } diff --git a/execute_task.go b/execute_task.go index 20cfb291..459d66dc 100644 --- a/execute_task.go +++ b/execute_task.go @@ -18,7 +18,7 @@ import ( "strconv" "strings" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // ExecuteTask is used to poll for long running server execute job completion. diff --git a/exists_command.go b/exists_command.go index a64ed512..f050daf2 100644 --- a/exists_command.go +++ b/exists_command.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // guarantee existsCommand implements command interface diff --git a/exp_bit_test.go b/exp_bit_test.go index c0cef8f7..3f5053ab 100644 --- a/exp_bit_test.go +++ b/exp_bit_test.go @@ -15,7 +15,7 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/exp_hll_test.go b/exp_hll_test.go index 9b8410c5..2c7de539 100644 --- a/exp_hll_test.go +++ b/exp_hll_test.go @@ -15,7 +15,7 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/exp_list.go b/exp_list.go index a48b0747..610e00b2 100644 --- a/exp_list.go +++ b/exp_list.go @@ -17,7 +17,7 @@ package aerospike import ( "fmt" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) const expListMODULE int64 = 0 diff --git a/exp_list_test.go b/exp_list_test.go index dd78e7fd..64aea581 100644 --- a/exp_list_test.go +++ b/exp_list_test.go @@ -15,7 +15,7 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/exp_map.go b/exp_map.go index 7eb27219..b3789d28 100644 --- a/exp_map.go +++ b/exp_map.go @@ -17,7 +17,7 @@ package aerospike import ( "fmt" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) const expMapMODULE int64 = 0 diff --git a/exp_map_test.go b/exp_map_test.go index fa7f7633..54d872df 100644 --- a/exp_map_test.go +++ b/exp_map_test.go @@ -15,7 +15,7 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/exp_ops_test.go b/exp_ops_test.go index 2b62ba64..70c765b4 100644 --- a/exp_ops_test.go +++ b/exp_ops_test.go @@ -21,8 +21,8 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + ast "github.com/aerospike/aerospike-client-go/v8/types" ) const udfPredexpBody = `local function putBin(r,name,value) diff --git a/expression.go b/expression.go index 56136654..cb363840 100644 --- a/expression.go +++ b/expression.go @@ -17,8 +17,8 @@ package aerospike import ( "encoding/base64" - "github.com/aerospike/aerospike-client-go/v7/types" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + "github.com/aerospike/aerospike-client-go/v8/types" + ParticleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" ) // ExpressionArgument is used for passing arguments to filter expressions. @@ -653,7 +653,6 @@ func ExpBinExists(name string) *Expression { // LDT = 21 // GEOJSON = 23 func ExpBinType(name string) *Expression { - // TODO: Improve documentation and provide examples. return newFilterExpression( &expOpBIN_TYPE, StringValue(name), diff --git a/expression_ops_test.go b/expression_ops_test.go index d4e39811..4642a843 100644 --- a/expression_ops_test.go +++ b/expression_ops_test.go @@ -15,8 +15,8 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + ast "github.com/aerospike/aerospike-client-go/v8/types" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" @@ -60,7 +60,7 @@ var _ = gg.Describe("Expression Operations", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"C": []interface{}{nil, []interface{}{"a", "b", "c", "d"}}, "var": []interface{}{"a", "b", "c", "d"}})) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"C": as.OpResults{nil, []any{"a", "b", "c", "d"}}, "var": []any{"a", "b", "c", "d"}})) }) gg.It("Read Eval error should work", func() { @@ -212,7 +212,7 @@ var _ = gg.Describe("Expression Operations", func() { gm.Expect(err).ToNot(gm.HaveOccurred()) gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{binC: []interface{}{nil, nil}})) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{binC: as.OpResults{nil, nil}})) }) gg.It("Return Nil should work", func() { @@ -235,7 +235,7 @@ var _ = gg.Describe("Expression Operations", func() { as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5, binC: []interface{}{nil, 5}})) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5, binC: as.OpResults{nil, 5}})) r, err = client.Operate(nil, keyA, as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), @@ -253,7 +253,7 @@ var _ = gg.Describe("Expression Operations", func() { as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5.1, binC: []interface{}{nil, 5.1}})) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5.1, binC: as.OpResults{nil, 5.1}})) r, err = client.Operate(nil, keyA, as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), @@ -272,7 +272,7 @@ var _ = gg.Describe("Expression Operations", func() { as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: str, binC: []interface{}{nil, str}})) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: str, binC: as.OpResults{nil, str}})) r, err = client.Operate(nil, keyA, as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), @@ -291,7 +291,7 @@ var _ = gg.Describe("Expression Operations", func() { as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: blob, binC: []interface{}{nil, blob}})) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: blob, binC: as.OpResults{nil, blob}})) r, err = client.Operate(nil, keyA, as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), @@ -309,7 +309,7 @@ var _ = gg.Describe("Expression Operations", func() { as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), ) gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: true, binC: []interface{}{nil, true}})) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: true, binC: as.OpResults{nil, true}})) }) gg.It("Return HLL should work", func() { @@ -324,11 +324,11 @@ var _ = gg.Describe("Expression Operations", func() { ) gm.Expect(err).ToNot(gm.HaveOccurred()) gm.Expect(r.Bins).To(gm.Equal(as.BinMap{ - binH: []interface{}{ + binH: as.OpResults{ nil, as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), }, - binC: []interface{}{ + binC: as.OpResults{ nil, as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), }, diff --git a/expression_test.go b/expression_test.go index f175f1cf..04926a95 100644 --- a/expression_test.go +++ b/expression_test.go @@ -18,8 +18,8 @@ import ( "fmt" "time" - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + ast "github.com/aerospike/aerospike-client-go/v8/types" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/filter.go b/filter.go index f6f6de25..5e4d95c7 100644 --- a/filter.go +++ b/filter.go @@ -17,7 +17,7 @@ package aerospike import ( "fmt" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + ParticleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" ) // Filter specifies a query filter definition. diff --git a/geo_test.go b/geo_test.go index 3b366664..8ee2a629 100644 --- a/geo_test.go +++ b/geo_test.go @@ -17,7 +17,7 @@ package aerospike_test import ( "fmt" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/go.mod b/go.mod index 6f2b6d8e..4c9efd62 100644 --- a/go.mod +++ b/go.mod @@ -1,35 +1,27 @@ -module github.com/aerospike/aerospike-client-go/v7 +module github.com/aerospike/aerospike-client-go/v8 -go 1.20 +go 1.23 require ( - github.com/onsi/ginkgo/v2 v2.16.0 - github.com/onsi/gomega v1.32.0 + github.com/onsi/ginkgo/v2 v2.22.0 + github.com/onsi/gomega v1.36.1 github.com/yuin/gopher-lua v1.1.1 - golang.org/x/sync v0.7.0 - google.golang.org/grpc v1.63.3 - google.golang.org/protobuf v1.34.2 + golang.org/x/sync v0.10.0 ) require ( github.com/go-logr/logr v1.4.2 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect - github.com/golang/protobuf v1.5.4 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect - github.com/kr/pretty v0.1.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect + github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d // indirect - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + golang.org/x/net v0.32.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + golang.org/x/tools v0.28.0 // indirect + google.golang.org/protobuf v1.35.2 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -retract ( - v7.3.0 // `Client.BatchGetOperate` issue - v7.7.0 // nil deref in tend logic -) diff --git a/go.sum b/go.sum index b2dbf46a..882d2ea1 100644 --- a/go.sum +++ b/go.sum @@ -1,82 +1,48 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 h1:y3N7Bm7Y9/CtpiVkw/ZWj6lSlDF3F74SfKwfTCer72Q= -github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= -github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da h1:xRmpO92tb8y+Z85iUOMOicpCfaYcv7o3Cg3wKrIpg8g= -github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= -github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg= +github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw= +github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0= -github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d h1:JU0iKnSg02Gmb5ZdV8nYsKEKsP6o/FGVWTrw4i1DA9A= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= -google.golang.org/grpc v1.63.3 h1:FGVegD7MHo/zhaGduk/R85WvSFJ+si70UQIJ0fg+BiU= -google.golang.org/grpc v1.63.3/go.mod h1:5FFeE/YiGPD2flWFCrCx8K3Ay7hALATnKiI8U3avIuw= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/hll_operation.go b/hll_operation.go index c32e079c..cc1f5d38 100644 --- a/hll_operation.go +++ b/hll_operation.go @@ -18,7 +18,7 @@ package aerospike import ( "fmt" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + ParticleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" ) // HyperLogLog (HLL) operations. diff --git a/hll_operation_test.go b/hll_operation_test.go index 3db5b30e..01ebab43 100644 --- a/hll_operation_test.go +++ b/hll_operation_test.go @@ -21,8 +21,8 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + ast "github.com/aerospike/aerospike-client-go/v8/types" ) var _ = gg.Describe("HyperLogLog Test", func() { @@ -169,7 +169,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { } record := expectSuccess(key, ops...) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) count := result_list[1] count1 := result_list[2] description := result_list[3].([]interface{}) @@ -273,7 +273,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { } record := expectSuccess(key, ops...) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) count := result_list[1].(int) count1 := result_list[2].(int) description := result_list[3].([]interface{}) @@ -343,7 +343,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.HLLRefreshCountOp(binName), as.HLLDescribeOp(binName)) - resulta_list := recorda.Bins[binName].([]interface{}) + resulta_list := recorda.Bins[binName].(as.OpResults) counta := resulta_list[1].(int) counta1 := resulta_list[2].(int) descriptiona := resulta_list[3].([]interface{}) @@ -360,7 +360,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.HLLGetCountOp(binName), as.HLLDescribeOp(binName)) - resultb_list := recordb.Bins[binName].([]interface{}) + resultb_list := recordb.Bins[binName].(as.OpResults) countb := resultb_list[1].(int) n_added0 := resultb_list[2].(int) countb1 := resultb_list[4].(int) @@ -447,7 +447,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.DeleteOp(), as.HLLAddOp(p, binName, sub_vals, ix, -1), as.HLLGetCountOp(binName)) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) count := result_list[1].(int) expectHLLCount(ix, count, len(sub_vals)) @@ -457,7 +457,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { for i := 0; i < len(keys); i++ { record := expectSuccess(keys[i], as.GetBinOp(binName), as.HLLGetCountOp(binName)) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) hll := result_list[0].(as.HLLValue) gm.Expect(hll).NotTo(gm.BeNil()) @@ -480,7 +480,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { } record_union := expectSuccess(key, ops...) - union_result_list := record_union.Bins[binName].([]interface{}) + union_result_list := record_union.Bins[binName].(as.OpResults) union_count := union_result_list[2].(int) union_count2 := union_result_list[4].(int) @@ -492,7 +492,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { record := expectSuccess(key, as.HLLAddOp(p, binName, sub_vals, index_bits, -1), as.HLLGetCountOp(binName)) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) n_added := result_list[0].(int) count := result_list[1].(int) @@ -535,7 +535,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.DeleteOp(), as.HLLAddOp(as.DefaultHLLPolicy(), otherName, entries, index_bits, -1), as.GetBinOp(otherName)) - result_list := record.Bins[otherName].([]interface{}) + result_list := record.Bins[otherName].(as.OpResults) hll := result_list[1].(as.HLLValue) hlls = append(hlls, hll) @@ -640,7 +640,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.HLLAddOp(as.DefaultHLLPolicy(), binName, sub_vals, index_bits, -1), as.GetBinOp(binName)) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) hlls = append(hlls, result_list[1].(as.HLLValue)) expected_union_count += len(sub_vals) vals = append(vals, sub_vals) @@ -655,7 +655,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { record := expectSuccess(key, as.HLLGetUnionOp(binName, hlls), as.HLLGetUnionCountOp(binName, hlls)) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) union_count := result_list[1].(int) expectHLLCount(index_bits, union_count, expected_union_count) @@ -665,7 +665,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { record = expectSuccess(key, as.PutOp(as.NewBin(binName, union_hll)), as.HLLGetCountOp(binName)) - result_list = record.Bins[binName].([]interface{}) + result_list = record.Bins[binName].(as.OpResults) union_count_2 := result_list[1].(int) gm.Expect(union_count).To(gm.Equal(union_count_2)) @@ -690,7 +690,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.HLLGetCountOp(binName), as.HLLDescribeOp(binName)) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) count := result_list[0].(int) description := result_list[1].([]interface{}) @@ -733,7 +733,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.HLLAddOp(as.DefaultHLLPolicy(), binName, common, index_bits, minhash_bits), as.GetBinOp(binName)) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) hlls = append(hlls, result_list[2].(as.HLLValue)) } @@ -743,7 +743,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, minhash_bits), as.HLLSetUnionOp(as.DefaultHLLPolicy(), binName, hlls), as.HLLDescribeOp(binName)) - result_list := record.Bins[binName].([]interface{}) + result_list := record.Bins[binName].(as.OpResults) description := result_list[1].([]interface{}) expectDescription(description, index_bits, minhash_bits) @@ -751,7 +751,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { record = expectSuccess(key, as.HLLGetSimilarityOp(binName, hlls), as.HLLGetIntersectCountOp(binName, hlls)) - result_list = record.Bins[binName].([]interface{}) + result_list = record.Bins[binName].(as.OpResults) sim := result_list[0].(float64) intersect_count := result_list[1].(int) expected_similarity := overlap @@ -809,7 +809,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.HLLInitOp(as.DefaultHLLPolicy(), binName, nIndexBits, nMinhashBits), as.GetBinOp(binName)) - resultList := record.Bins[binName].([]interface{}) + resultList := record.Bins[binName].(as.OpResults) var hlls []as.HLLValue hlls = append(hlls, resultList[1].(as.HLLValue)) @@ -818,7 +818,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { as.HLLGetSimilarityOp(binName, hlls), as.HLLGetIntersectCountOp(binName, hlls)) - resultList = record.Bins[binName].([]interface{}) + resultList = record.Bins[binName].(as.OpResults) sim := resultList[0].(float64) intersectCount := resultList[1].(int) @@ -848,19 +848,19 @@ var _ = gg.Describe("HyperLogLog Test", func() { var hlls []as.HLLValue var hmhs []as.HLLValue - resultList := record.Bins[binName].([]interface{}) + resultList := record.Bins[binName].(as.OpResults) hlls = append(hlls, resultList[1].(as.HLLValue)) hlls = append(hlls, hlls[0]) - resultList = record.Bins[otherBinName].([]interface{}) + resultList = record.Bins[otherBinName].(as.OpResults) hmhs = append(hmhs, resultList[1].(as.HLLValue)) hmhs = append(hmhs, hmhs[0]) record = expectSuccess(key, as.HLLGetIntersectCountOp(binName, hlls), as.HLLGetSimilarityOp(binName, hlls)) - resultList = record.Bins[binName].([]interface{}) + resultList = record.Bins[binName].(as.OpResults) intersectCount := resultList[0].(int) @@ -876,7 +876,7 @@ var _ = gg.Describe("HyperLogLog Test", func() { record = expectSuccess(key, as.HLLGetIntersectCountOp(binName, hmhs), as.HLLGetSimilarityOp(binName, hmhs)) - resultList = record.Bins[binName].([]interface{}) + resultList = record.Bins[binName].(as.OpResults) intersectCount = resultList[0].(int) gm.Expect(float64(intersectCount) < 1.8*float64(len(entries))).To(gm.BeTrue()) diff --git a/host.go b/host.go index 0e3e969e..dd95ade4 100644 --- a/host.go +++ b/host.go @@ -19,7 +19,7 @@ import ( "net" "strconv" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // Host name/port of database server. diff --git a/host_test.go b/host_test.go index 95c45f6b..50721da8 100644 --- a/host_test.go +++ b/host_test.go @@ -15,7 +15,7 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/index_test.go b/index_test.go index 474fa594..dd130b0e 100644 --- a/index_test.go +++ b/index_test.go @@ -18,7 +18,7 @@ import ( "math" "math/rand" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/info.go b/info.go index 79bc4697..d3e5b76d 100644 --- a/info.go +++ b/info.go @@ -20,8 +20,8 @@ import ( "strings" "time" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" ) const ( diff --git a/internal/atomic/bool_test.go b/internal/atomic/bool_test.go index f78496e0..03ab8b8c 100644 --- a/internal/atomic/bool_test.go +++ b/internal/atomic/bool_test.go @@ -18,7 +18,7 @@ import ( "runtime" "sync" - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/internal/atomic" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/internal/atomic/guard_test.go b/internal/atomic/guard_test.go index dc868d79..17765fdb 100644 --- a/internal/atomic/guard_test.go +++ b/internal/atomic/guard_test.go @@ -17,7 +17,7 @@ package atomic_test import ( "runtime" - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/internal/atomic" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/internal/atomic/int_test.go b/internal/atomic/int_test.go index 6e3b2ef5..790fbf32 100644 --- a/internal/atomic/int_test.go +++ b/internal/atomic/int_test.go @@ -18,7 +18,7 @@ import ( "runtime" "sync" - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/internal/atomic" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/internal/atomic/queue_test.go b/internal/atomic/queue_test.go index 3299489f..f86935f8 100644 --- a/internal/atomic/queue_test.go +++ b/internal/atomic/queue_test.go @@ -17,7 +17,7 @@ package atomic_test import ( "runtime" - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/internal/atomic" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/internal/atomic/typed_val_test.go b/internal/atomic/typed_val_test.go index e45e14a2..6fbf0f91 100644 --- a/internal/atomic/typed_val_test.go +++ b/internal/atomic/typed_val_test.go @@ -15,7 +15,7 @@ package atomic_test import ( - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/internal/atomic" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/internal/lua/instance.go b/internal/lua/instance.go index 7dba847b..a2d5d9ba 100644 --- a/internal/lua/instance.go +++ b/internal/lua/instance.go @@ -18,9 +18,9 @@ package lua import ( - luaLib "github.com/aerospike/aerospike-client-go/v7/internal/lua/resources" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + luaLib "github.com/aerospike/aerospike-client-go/v8/internal/lua/resources" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" lua "github.com/yuin/gopher-lua" ) diff --git a/internal/lua/lua_aerospike.go b/internal/lua/lua_aerospike.go index 8ccb6973..49faced3 100644 --- a/internal/lua/lua_aerospike.go +++ b/internal/lua/lua_aerospike.go @@ -18,7 +18,7 @@ package lua import ( - "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v8/logger" lua "github.com/yuin/gopher-lua" ) diff --git a/internal/lua/lua_aerospike_test.go b/internal/lua/lua_aerospike_test.go index db052b9e..26d51b74 100644 --- a/internal/lua/lua_aerospike_test.go +++ b/internal/lua/lua_aerospike_test.go @@ -23,7 +23,7 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - ilua "github.com/aerospike/aerospike-client-go/v7/internal/lua" + ilua "github.com/aerospike/aerospike-client-go/v8/internal/lua" ) var _ = gg.Describe("Lua Aerospike API Test", func() { diff --git a/internal/lua/lua_list_test.go b/internal/lua/lua_list_test.go index da097b83..c6017e5f 100644 --- a/internal/lua/lua_list_test.go +++ b/internal/lua/lua_list_test.go @@ -23,7 +23,7 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - ilua "github.com/aerospike/aerospike-client-go/v7/internal/lua" + ilua "github.com/aerospike/aerospike-client-go/v8/internal/lua" ) var _ = gg.Describe("Lua List API Test", func() { diff --git a/internal/lua/lua_map_test.go b/internal/lua/lua_map_test.go index d73529e4..22d8d8fd 100644 --- a/internal/lua/lua_map_test.go +++ b/internal/lua/lua_map_test.go @@ -23,7 +23,7 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - ilua "github.com/aerospike/aerospike-client-go/v7/internal/lua" + ilua "github.com/aerospike/aerospike-client-go/v8/internal/lua" ) var _ = gg.Describe("Lua Map API Test", func() { diff --git a/key.go b/key.go index 788d09fc..dddb6fe8 100644 --- a/key.go +++ b/key.go @@ -18,8 +18,8 @@ import ( "bytes" "fmt" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) // Key is the unique record identifier. Records can be identified using a specified namespace, diff --git a/key_bench_test.go b/key_bench_test.go index 5c9b183b..487829d2 100644 --- a/key_bench_test.go +++ b/key_bench_test.go @@ -19,7 +19,7 @@ import ( "strings" "testing" - "github.com/aerospike/aerospike-client-go/v7/pkg/ripemd160" + "github.com/aerospike/aerospike-client-go/v8/pkg/ripemd160" ) var res = make([]byte, 20) diff --git a/key_helper.go b/key_helper.go index f237fc89..7ed1af02 100644 --- a/key_helper.go +++ b/key_helper.go @@ -16,10 +16,11 @@ package aerospike import ( "encoding/binary" + "fmt" "math" - "github.com/aerospike/aerospike-client-go/v7/pkg/ripemd160" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/pkg/ripemd160" + "github.com/aerospike/aerospike-client-go/v8/types" ) type keyWriter struct { @@ -150,6 +151,5 @@ func (vb *keyWriter) writeKey(val Value) Error { return nil } - // TODO: Replace the error message with fmt.Sprintf("Key Generation Error. Value type not supported: %T", val) - return newError(types.PARAMETER_ERROR, "Key Generation Error. Value not supported: "+val.String()) + return newError(types.PARAMETER_ERROR, fmt.Sprintf("Key Generation Error. Value type not supported: %T", val)) } diff --git a/key_test.go b/key_test.go index 541e80e5..3cb777ed 100644 --- a/key_test.go +++ b/key_test.go @@ -19,7 +19,7 @@ import ( "math" "strings" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/load_test.go b/load_test.go index 58c4eadd..c9d2897b 100644 --- a/load_test.go +++ b/load_test.go @@ -20,7 +20,7 @@ import ( "sync" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/login_command.go b/login_command.go index 159cb9d2..473d5520 100644 --- a/login_command.go +++ b/login_command.go @@ -17,10 +17,10 @@ package aerospike import ( "time" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type sessionInfo struct { diff --git a/metrics_policy.go b/metrics_policy.go index f53165f2..a55f20cf 100644 --- a/metrics_policy.go +++ b/metrics_policy.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types/histogram" + "github.com/aerospike/aerospike-client-go/v8/types/histogram" ) // MetricsPolicy specifies client periodic metrics configuration. diff --git a/multi_command.go b/multi_command.go index d9527d22..87ef9ce1 100644 --- a/multi_command.go +++ b/multi_command.go @@ -19,8 +19,8 @@ import ( "math/rand" "reflect" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type baseMultiCommand struct { diff --git a/node.go b/node.go index 6dc85ddc..02389d95 100644 --- a/node.go +++ b/node.go @@ -24,9 +24,9 @@ import ( "golang.org/x/sync/errgroup" - iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + iatomic "github.com/aerospike/aerospike-client-go/v8/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" ) const ( diff --git a/node_stats.go b/node_stats.go index 1a07daaa..5b974815 100644 --- a/node_stats.go +++ b/node_stats.go @@ -18,14 +18,15 @@ import ( "encoding/json" "sync" - iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - hist "github.com/aerospike/aerospike-client-go/v7/types/histogram" + iatomic "github.com/aerospike/aerospike-client-go/v8/internal/atomic" + hist "github.com/aerospike/aerospike-client-go/v8/types/histogram" ) // nodeStats keeps track of client's internal node statistics // These statistics are aggregated once per tend in the cluster object // and then are served to the end-user. type nodeStats struct { + // TODO: Remove this lock and abstract it out using Generics m sync.Mutex // Attempts to open a connection (failed + successful) ConnectionsAttempts iatomic.Int `json:"connections-attempts"` diff --git a/node_test.go b/node_test.go index 20e56609..28484f2b 100644 --- a/node_test.go +++ b/node_test.go @@ -18,7 +18,7 @@ import ( "errors" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/node_validator.go b/node_validator.go index 03874211..0bf27f6f 100644 --- a/node_validator.go +++ b/node_validator.go @@ -21,8 +21,8 @@ import ( "strconv" "strings" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" ) type nodesToAddT map[string]*Node diff --git a/operate_command_read.go b/operate_command_read.go index 450a9802..193e457e 100644 --- a/operate_command_read.go +++ b/operate_command_read.go @@ -20,7 +20,7 @@ type operateCommandRead struct { args operateArgs } -func newOperateCommandRead(cluster *Cluster, key *Key, args operateArgs, useOpResults bool) (operateCommandRead, Error) { +func newOperateCommandRead(cluster *Cluster, key *Key, args operateArgs) (operateCommandRead, Error) { rdCommand, err := newReadCommand(cluster, &args.writePolicy.BasePolicy, key, nil) if err != nil { return operateCommandRead{}, err @@ -31,7 +31,6 @@ func newOperateCommandRead(cluster *Cluster, key *Key, args operateArgs, useOpRe args: args, } - res.useOpResults = useOpResults res.isOperation = true return res, nil diff --git a/operate_command_write.go b/operate_command_write.go index 283b92e4..ed62241c 100644 --- a/operate_command_write.go +++ b/operate_command_write.go @@ -14,17 +14,16 @@ package aerospike -import "github.com/aerospike/aerospike-client-go/v7/types" +import "github.com/aerospike/aerospike-client-go/v8/types" type operateCommandWrite struct { baseWriteCommand - record *Record - args operateArgs - useOpResults bool + record *Record + args operateArgs } -func newOperateCommandWrite(cluster *Cluster, key *Key, args operateArgs, useOpResults bool) (operateCommandWrite, Error) { +func newOperateCommandWrite(cluster *Cluster, key *Key, args operateArgs) (operateCommandWrite, Error) { bwc, err := newBaseWriteCommand(cluster, args.writePolicy, key) if err != nil { return operateCommandWrite{}, err @@ -33,7 +32,6 @@ func newOperateCommandWrite(cluster *Cluster, key *Key, args operateArgs, useOpR return operateCommandWrite{ baseWriteCommand: bwc, args: args, - useOpResults: useOpResults, }, nil } @@ -54,7 +52,7 @@ func (cmd *operateCommandWrite) parseResult(ifc command, conn *Connection) Error switch rp.resultCode { case types.OK: var err Error - cmd.record, err = rp.parseRecord(cmd.key, true, cmd.useOpResults) + cmd.record, err = rp.parseRecord(cmd.key, true) if err != nil { return err } diff --git a/packer.go b/packer.go index 4f588c01..b3e92017 100644 --- a/packer.go +++ b/packer.go @@ -22,10 +22,10 @@ import ( "reflect" "time" - "github.com/aerospike/aerospike-client-go/v7/types" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + "github.com/aerospike/aerospike-client-go/v8/types" + ParticleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) var packObjectReflect func(BufferEx, interface{}, bool) (int, Error) diff --git a/packer_reflect.go b/packer_reflect.go index 5898cad4..5c0f178b 100644 --- a/packer_reflect.go +++ b/packer_reflect.go @@ -20,7 +20,7 @@ import ( "fmt" "reflect" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) func init() { diff --git a/partition.go b/partition.go index 38b63633..1121dc7c 100644 --- a/partition.go +++ b/partition.go @@ -17,7 +17,7 @@ package aerospike import ( "fmt" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // Partition encapsulates partition information. diff --git a/partition_filter.go b/partition_filter.go index 5dd37755..84c3db55 100644 --- a/partition_filter.go +++ b/partition_filter.go @@ -19,7 +19,7 @@ import ( "bytes" "encoding/gob" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // PartitionFilter is used in scan/queries. This filter is also used as a cursor. diff --git a/partition_parser.go b/partition_parser.go index 7d769ffc..b5eed623 100644 --- a/partition_parser.go +++ b/partition_parser.go @@ -23,8 +23,8 @@ import ( "strconv" "sync" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" ) const ( diff --git a/partition_tracker.go b/partition_tracker.go index 8e6f80c4..bd45c91c 100644 --- a/partition_tracker.go +++ b/partition_tracker.go @@ -20,8 +20,8 @@ import ( "strings" "time" - atmc "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - "github.com/aerospike/aerospike-client-go/v7/types" + atmc "github.com/aerospike/aerospike-client-go/v8/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/types" ) type partitionTracker struct { @@ -273,10 +273,7 @@ func (pt *partitionTracker) setDigest(nodePartitions *nodePartitions, key *Key) partitionId := key.PartitionId() pt.partitions[partitionId-pt.partitionBegin].Digest = key.Digest() - // nodePartitions is nil in Proxy client - if nodePartitions != nil { - nodePartitions.recordCount++ - } + nodePartitions.recordCount++ } func (pt *partitionTracker) setLast(nodePartitions *nodePartitions, key *Key, bval *int64) { @@ -290,10 +287,7 @@ func (pt *partitionTracker) setLast(nodePartitions *nodePartitions, key *Key, bv ps.BVal = *bval } - // nodePartitions is nil in Proxy client - if nodePartitions != nil { - nodePartitions.recordCount++ - } + nodePartitions.recordCount++ } func (pt *partitionTracker) allowRecord(np *nodePartitions) bool { diff --git a/partitions.go b/partitions.go index 18d8b3f5..16d55046 100644 --- a/partitions.go +++ b/partitions.go @@ -19,7 +19,7 @@ import ( "fmt" "strconv" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // Partitions represents a list of partitions diff --git a/peers.go b/peers.go index 1dfae9bd..9eeb6c6f 100644 --- a/peers.go +++ b/peers.go @@ -17,7 +17,7 @@ package aerospike import ( "sync" - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/internal/atomic" ) type peers struct { diff --git a/peers_parser.go b/peers_parser.go index 2ef89c5d..3a644dc7 100644 --- a/peers_parser.go +++ b/peers_parser.go @@ -15,12 +15,12 @@ package aerospike import ( - // "github.com/aerospike/aerospike-client-go/v7/logger" + // "github.com/aerospike/aerospike-client-go/v8/logger" "io" "strconv" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) var aeroerr = newError(types.PARSE_ERROR, "Error parsing peers list.") diff --git a/query_aggregate_command.go b/query_aggregate_command.go index c4693478..321819ca 100644 --- a/query_aggregate_command.go +++ b/query_aggregate_command.go @@ -19,9 +19,9 @@ package aerospike import ( "fmt" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" lua "github.com/yuin/gopher-lua" ) diff --git a/query_aggregate_test.go b/query_aggregate_test.go index d8486fe7..d2429b4b 100644 --- a/query_aggregate_test.go +++ b/query_aggregate_test.go @@ -20,7 +20,7 @@ import ( "os" "sync" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/query_context_test.go b/query_context_test.go index b5ee910b..8d47ae87 100644 --- a/query_context_test.go +++ b/query_context_test.go @@ -15,7 +15,7 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/query_objects_executor.go b/query_objects_executor.go index 63ad74d4..0a7e4f0d 100644 --- a/query_objects_executor.go +++ b/query_objects_executor.go @@ -19,7 +19,7 @@ import ( "sync" "time" - "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v8/logger" "golang.org/x/sync/semaphore" ) diff --git a/query_test.go b/query_test.go index 26e2cd27..b7ca6d6b 100644 --- a/query_test.go +++ b/query_test.go @@ -20,8 +20,8 @@ import ( "math" "math/rand" - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + ast "github.com/aerospike/aerospike-client-go/v8/types" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/random_operation_test.go b/random_operation_test.go index c3bfa374..d2b32e0e 100644 --- a/random_operation_test.go +++ b/random_operation_test.go @@ -19,7 +19,7 @@ import ( "strings" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/read_command.go b/read_command.go index e272ca35..1839e7d5 100644 --- a/read_command.go +++ b/read_command.go @@ -15,15 +15,14 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) type readCommand struct { baseReadCommand - binNames []string - isOperation bool - useOpResults bool + binNames []string + isOperation bool } func newReadCommand( @@ -75,7 +74,7 @@ func (cmd *readCommand) parseResult(ifc command, conn *Connection) Error { } var err Error - cmd.record, err = rp.parseRecord(cmd.key, cmd.isOperation, cmd.useOpResults) + cmd.record, err = rp.parseRecord(cmd.key, cmd.isOperation) if err != nil { return err } diff --git a/read_command_reflect.go b/read_command_reflect.go index 80e361d7..5e277190 100644 --- a/read_command_reflect.go +++ b/read_command_reflect.go @@ -23,8 +23,8 @@ import ( "strings" "time" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) // if this file is included in the build, it will include this method diff --git a/read_header_command.go b/read_header_command.go index 5d0ddcfd..c2f81fc7 100644 --- a/read_header_command.go +++ b/read_header_command.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) type readHeaderCommand struct { diff --git a/record_parser.go b/record_parser.go index c700e2ba..2b953ff1 100644 --- a/record_parser.go +++ b/record_parser.go @@ -17,9 +17,9 @@ package aerospike import ( "fmt" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) // Task interface defines methods for asynchronous tasks. @@ -157,13 +157,10 @@ func (rp *recordParser) parseTranDeadline(txn *Txn) { rp.cmd.dataOffset += int(size) } } -func (rp *recordParser) parseRecord(key *Key, isOperation, useOpResults bool) (*Record, Error) { +func (rp *recordParser) parseRecord(key *Key, isOperation bool) (*Record, Error) { var bins BinMap receiveOffset := rp.cmd.dataOffset - // opCmd, isOperation := ifc.(*operateCommand) - var binNamesSet []string - // There can be fields in the response (setname etc). // But for now, ignore them. Expose them to the API if needed in the future. if rp.fieldCount > 0 { @@ -202,7 +199,6 @@ func (rp *recordParser) parseRecord(key *Key, isOperation, useOpResults bool) (* } else { // Make a list to store all values. bins[name] = OpResults{prev, value} - binNamesSet = append(binNamesSet, name) } } else { bins[name] = value @@ -212,12 +208,5 @@ func (rp *recordParser) parseRecord(key *Key, isOperation, useOpResults bool) (* } } - // TODO: Remove this in the next major release - if isOperation && !useOpResults { - for i := range binNamesSet { - bins[binNamesSet[i]] = []interface{}(bins[binNamesSet[i]].(OpResults)) - } - } - return newRecord(rp.cmd.node, key, bins, rp.generation, rp.expiration), nil } diff --git a/recordset.go b/recordset.go index 16b85f9e..dcf2c88e 100644 --- a/recordset.go +++ b/recordset.go @@ -21,7 +21,7 @@ import ( "runtime" "sync" - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/internal/atomic" ) // Result is the value returned by Recordset's Results() function. diff --git a/recordset_test.go b/recordset_test.go index d0f12426..773db9b9 100644 --- a/recordset_test.go +++ b/recordset_test.go @@ -17,7 +17,7 @@ package aerospike import ( "time" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/scan_objects_executor.go b/scan_objects_executor.go index 0ee92a36..2cccf718 100644 --- a/scan_objects_executor.go +++ b/scan_objects_executor.go @@ -19,7 +19,7 @@ import ( "sync" "time" - "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v8/logger" "golang.org/x/sync/semaphore" ) diff --git a/scan_partition_command.go b/scan_partition_command.go index 364cdc99..c34366ad 100644 --- a/scan_partition_command.go +++ b/scan_partition_command.go @@ -14,7 +14,7 @@ package aerospike -import "github.com/aerospike/aerospike-client-go/v7/types" +import "github.com/aerospike/aerospike-client-go/v8/types" type scanPartitionCommand struct { baseMultiCommand diff --git a/scan_partition_objects_command.go b/scan_partition_objects_command.go index 4d136071..054a5ffb 100644 --- a/scan_partition_objects_command.go +++ b/scan_partition_objects_command.go @@ -14,7 +14,7 @@ package aerospike -import "github.com/aerospike/aerospike-client-go/v7/types" +import "github.com/aerospike/aerospike-client-go/v8/types" type scanPartitionObjectsCommand struct { baseMultiCommand diff --git a/scan_test.go b/scan_test.go index 0d6cf8c5..c4d7aead 100644 --- a/scan_test.go +++ b/scan_test.go @@ -19,9 +19,9 @@ import ( "math" "math/rand" - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" - particleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + as "github.com/aerospike/aerospike-client-go/v8" + ast "github.com/aerospike/aerospike-client-go/v8/types" + particleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/security_test.go b/security_test.go index 7f643b31..8400968e 100644 --- a/security_test.go +++ b/security_test.go @@ -18,7 +18,7 @@ import ( "fmt" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/server_command.go b/server_command.go index 73f8371f..6595e5e6 100644 --- a/server_command.go +++ b/server_command.go @@ -15,8 +15,8 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type serverCommand struct { diff --git a/single_command.go b/single_command.go index 9739288a..9a1ea0f6 100644 --- a/single_command.go +++ b/single_command.go @@ -15,7 +15,7 @@ package aerospike import ( - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type singleCommand struct { diff --git a/statement.go b/statement.go index a9d3857d..1f077265 100644 --- a/statement.go +++ b/statement.go @@ -18,7 +18,7 @@ import ( "fmt" "math/rand" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // Statement encapsulates query statement parameters. diff --git a/task.go b/task.go index c019ad4a..a6d9631b 100644 --- a/task.go +++ b/task.go @@ -17,8 +17,8 @@ package aerospike import ( "time" - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/types" ) // Task interface defines methods for asynchronous tasks. diff --git a/tools/asinfo/asinfo.go b/tools/asinfo/asinfo.go index 3288cbcb..49670379 100644 --- a/tools/asinfo/asinfo.go +++ b/tools/asinfo/asinfo.go @@ -20,7 +20,7 @@ import ( "os" "strings" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" ) var ( diff --git a/tools/benchmark/benchmark.go b/tools/benchmark/benchmark.go index ba7d5b95..0998678b 100644 --- a/tools/benchmark/benchmark.go +++ b/tools/benchmark/benchmark.go @@ -32,9 +32,9 @@ import ( "sync/atomic" "time" - as "github.com/aerospike/aerospike-client-go/v7" - asl "github.com/aerospike/aerospike-client-go/v7/logger" - ast "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + asl "github.com/aerospike/aerospike-client-go/v8/logger" + ast "github.com/aerospike/aerospike-client-go/v8/types" ) // TStats is a goroutine's statistics values @@ -170,17 +170,14 @@ func main() { dbHost := as.NewHost(*host, *port) dbHost.TLSName = *tlsName - var client as.ClientIfc - nclient, err := as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + client, err := as.NewClientWithPolicyAndHost(clientPolicy, dbHost) if err != nil { logger.Fatal(err) } - cc, _ := nclient.WarmUp(*warmUp) + cc, _ := client.WarmUp(*warmUp) logger.Printf("Warm-up conns.:\t%d", cc) - logger.Println("Nodes Found:", nclient.GetNodeNames()) - - client = nclient + logger.Println("Nodes Found:", client.GetNodeNames()) go reporter() @@ -410,7 +407,7 @@ func incOnError(op, timeout *int, err error) { } } -func runBench_I(client as.ClientIfc, ident int, times int) { +func runBench_I(client *as.Client, ident int, times int) { defer wg.Done() xr := NewXorRand() @@ -519,7 +516,7 @@ func runBench_I(client as.ClientIfc, ident int, times int) { countReportChan <- &TStats{false, WCount, 0, writeErr, 0, writeTOErr, 0, wMinLat, wMaxLat, 0, 0, wLatTotal, 0, wLatList, nil} } -func runBench_RU(client as.ClientIfc, ident int, times int) { +func runBench_RU(client *as.Client, ident int, times int) { defer wg.Done() xr := NewXorRand() diff --git a/tools/cli/cli.go b/tools/cli/cli.go index a2507928..eed5ee75 100644 --- a/tools/cli/cli.go +++ b/tools/cli/cli.go @@ -21,8 +21,8 @@ import ( "runtime" "strings" - as "github.com/aerospike/aerospike-client-go/v7" - asl "github.com/aerospike/aerospike-client-go/v7/logger" + as "github.com/aerospike/aerospike-client-go/v8" + asl "github.com/aerospike/aerospike-client-go/v8/logger" ) // flag information diff --git a/touch_command.go b/touch_command.go index ebd7ff92..4fcd2389 100644 --- a/touch_command.go +++ b/touch_command.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // guarantee touchCommand implements command interface diff --git a/truncate_test.go b/truncate_test.go index 46262bde..d1929e20 100644 --- a/truncate_test.go +++ b/truncate_test.go @@ -19,7 +19,7 @@ import ( "math/rand" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/txn.go b/txn.go index 9973ef2c..0d986454 100644 --- a/txn.go +++ b/txn.go @@ -19,8 +19,8 @@ import ( "sync/atomic" "time" - sm "github.com/aerospike/aerospike-client-go/v7/internal/atomic/map" - "github.com/aerospike/aerospike-client-go/v7/types" + sm "github.com/aerospike/aerospike-client-go/v8/internal/atomic/map" + "github.com/aerospike/aerospike-client-go/v8/types" ) // MRT state. diff --git a/txn_add_keys_command.go b/txn_add_keys_command.go index ed77af14..0959e06f 100644 --- a/txn_add_keys_command.go +++ b/txn_add_keys_command.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // guarantee txnAddKeysCommand implements command interface diff --git a/txn_close.go b/txn_close.go index 650cb353..1d7e5cad 100644 --- a/txn_close.go +++ b/txn_close.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // guarantee txnCloseCommand implements command interface diff --git a/txn_error.go b/txn_error.go index e821ec9e..f6d65f4f 100644 --- a/txn_error.go +++ b/txn_error.go @@ -14,7 +14,7 @@ package aerospike -import "github.com/aerospike/aerospike-client-go/v7/types" +import "github.com/aerospike/aerospike-client-go/v8/types" // TxnError implements Error interface for aerospike multi-record transaction specific errors. type TxnError struct { diff --git a/txn_mark_roll_forward.go b/txn_mark_roll_forward.go index de986574..9e58c239 100644 --- a/txn_mark_roll_forward.go +++ b/txn_mark_roll_forward.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // guarantee txnMarkRollForwardCommand implements command interface diff --git a/txn_roll.go b/txn_roll.go index 511780cf..a5585471 100644 --- a/txn_roll.go +++ b/txn_roll.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) type TxnRoll struct { diff --git a/txn_roll_batch.go b/txn_roll_batch.go index 1a1e7462..071e6ba9 100644 --- a/txn_roll_batch.go +++ b/txn_roll_batch.go @@ -17,8 +17,8 @@ package aerospike import ( "reflect" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type batchTxnRollCommand struct { @@ -31,7 +31,7 @@ type batchTxnRollCommand struct { } func newBatchTxnRollCommand( - client clientIfc, + client *Client, batch *batchNode, policy *BatchPolicy, txn *Txn, @@ -193,7 +193,7 @@ func (cmd *batchTxnRollCommand) commandType() commandType { return ttBatchWrite } -func (cmd *batchTxnRollCommand) executeSingle(client clientIfc) Error { +func (cmd *batchTxnRollCommand) executeSingle(client *Client) Error { panic(unreachable) } diff --git a/txn_roll_batch_single.go b/txn_roll_batch_single.go index 7e0166e8..665f253b 100644 --- a/txn_roll_batch_single.go +++ b/txn_roll_batch_single.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // guarantee batchSingleTxnRollCommand implements command interface diff --git a/txn_test.go b/txn_test.go index 252d32e2..91e45cb8 100644 --- a/txn_test.go +++ b/txn_test.go @@ -17,8 +17,8 @@ package aerospike_test import ( - as "github.com/aerospike/aerospike-client-go/v7" - "github.com/aerospike/aerospike-client-go/v7/types" + as "github.com/aerospike/aerospike-client-go/v8" + "github.com/aerospike/aerospike-client-go/v8/types" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/txn_verify_batch.go b/txn_verify_batch.go index 27d3d115..025590a1 100644 --- a/txn_verify_batch.go +++ b/txn_verify_batch.go @@ -17,8 +17,8 @@ package aerospike import ( "reflect" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + "github.com/aerospike/aerospike-client-go/v8/types" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type txnBatchVerifyCommand struct { @@ -30,7 +30,7 @@ type txnBatchVerifyCommand struct { } func newTxnBatchVerifyCommand( - client clientIfc, + client *Client, batch *batchNode, policy *BatchPolicy, keys []*Key, @@ -175,7 +175,7 @@ func (cmd *txnBatchVerifyCommand) commandType() commandType { return ttBatchRead } -func (cmd *txnBatchVerifyCommand) executeSingle(client clientIfc) Error { +func (cmd *txnBatchVerifyCommand) executeSingle(client *Client) Error { panic(unreachable) } diff --git a/txn_verify_batch_single.go b/txn_verify_batch_single.go index 7ea9b6ce..6ec9e2cd 100644 --- a/txn_verify_batch_single.go +++ b/txn_verify_batch_single.go @@ -17,10 +17,10 @@ package aerospike import ( "fmt" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/logger" + "github.com/aerospike/aerospike-client-go/v8/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) // guarantee batchSingleTxnVerifyCommand implements command interface diff --git a/types/histogram/bench_histogram_test.go b/types/histogram/bench_histogram_test.go index 48ea8824..6c42ebb7 100644 --- a/types/histogram/bench_histogram_test.go +++ b/types/histogram/bench_histogram_test.go @@ -17,7 +17,7 @@ package histogram_test import ( "testing" - "github.com/aerospike/aerospike-client-go/v7/types/histogram" + "github.com/aerospike/aerospike-client-go/v8/types/histogram" ) var ( diff --git a/types/histogram/histogram_test.go b/types/histogram/histogram_test.go index 6b231ee2..79d75701 100644 --- a/types/histogram/histogram_test.go +++ b/types/histogram/histogram_test.go @@ -17,7 +17,7 @@ package histogram_test import ( "testing" - "github.com/aerospike/aerospike-client-go/v7/types/histogram" + "github.com/aerospike/aerospike-client-go/v8/types/histogram" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/types/pool.go b/types/pool.go index ddcfd71c..5737464c 100644 --- a/types/pool.go +++ b/types/pool.go @@ -15,7 +15,7 @@ package types import ( - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v8/internal/atomic" ) // Pool implements a general purpose fixed-size pool. diff --git a/udf_test.go b/udf_test.go index 20661d76..1afdca31 100644 --- a/udf_test.go +++ b/udf_test.go @@ -23,7 +23,7 @@ import ( "sync" "time" - as "github.com/aerospike/aerospike-client-go/v7" + as "github.com/aerospike/aerospike-client-go/v8" gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" diff --git a/unpacker.go b/unpacker.go index e7a35a1b..4cb377fa 100644 --- a/unpacker.go +++ b/unpacker.go @@ -19,10 +19,10 @@ import ( "math" "reflect" - "github.com/aerospike/aerospike-client-go/v7/types" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + "github.com/aerospike/aerospike-client-go/v8/types" + ParticleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type unpacker struct { diff --git a/value.go b/value.go index 47da5e4f..7a51ff65 100644 --- a/value.go +++ b/value.go @@ -19,10 +19,10 @@ import ( "reflect" "strconv" - "github.com/aerospike/aerospike-client-go/v7/types" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + "github.com/aerospike/aerospike-client-go/v8/types" + ParticleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) // this function will be set in value_slow file if included @@ -704,7 +704,6 @@ type LongValue int64 // NewLongValue generates a LongValue instance. func NewLongValue(value int64) LongValue { - // TODO: Remove this type, it's not necessary next to IntegerValue return LongValue(value) } diff --git a/value_test.go b/value_test.go index 7c92487d..2d16eb5b 100644 --- a/value_test.go +++ b/value_test.go @@ -21,8 +21,8 @@ import ( gg "github.com/onsi/ginkgo/v2" gm "github.com/onsi/gomega" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" - "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + ParticleType "github.com/aerospike/aerospike-client-go/v8/types/particle_type" + "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) type testBLOB struct { diff --git a/werrgroup.go b/werrgroup.go index 7e36d334..1cc7e18f 100644 --- a/werrgroup.go +++ b/werrgroup.go @@ -20,7 +20,7 @@ import ( "golang.org/x/sync/semaphore" - "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v8/logger" ) type werrGroup struct { diff --git a/write_command.go b/write_command.go index 9624abee..15d61176 100644 --- a/write_command.go +++ b/write_command.go @@ -15,7 +15,7 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" ) // guarantee writeCommand implements command interface diff --git a/write_payload_command.go b/write_payload_command.go index 64fd7251..aacbc33d 100644 --- a/write_payload_command.go +++ b/write_payload_command.go @@ -15,9 +15,9 @@ package aerospike import ( - "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v8/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + Buffer "github.com/aerospike/aerospike-client-go/v8/utils/buffer" ) // guarantee writePayloadCommand implements command interface