Aerospike Client Go
Latest commit 7cb6228 Sep 18, 2018
Permalink
Failed to load latest commit information.
.travis remove ldt-enabled flag from the config file Oct 12, 2017
docs Merge branch 'patch-1' of https://github.com/Entea/aerospike-client-go Jun 12, 2018
examples Fix example Dec 12, 2016
internal/lua Introduce app_engine build tag to allow app_engine builds Jun 29, 2018
logger Synchronize logging at all situations Aug 18, 2018
performance Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
pkg fix for the case when nil buffer is passed into hash.Sum Oct 25, 2016
test/resources Added QueryAggregate Jan 13, 2016
tools Added LDAP Jul 30, 2018
types Use pointer receiver for AerospikeError.SetInDoubt and AerospikeError… Aug 22, 2018
utils Update copyright dates to include 2017 Jan 11, 2017
.build.yml Updated the Go versions for Testing Feb 13, 2018
.gitignore Added New API for high-performance complex data type packing, and rem… Dec 20, 2016
.travis.yml Add Go 1.11 to Travis' test versions Aug 27, 2018
CHANGELOG.md Updated Changelog Sep 18, 2018
LICENSE Improve marshalling of data types into and out of the Lua library Feb 4, 2016
README.md Improved merge map to work around the suspected race condition Aug 7, 2018
admin_command.go Fix minor unsigned length conversions for admin command Aug 2, 2018
admin_policy.go Update copyright dates to include 2017 Jan 11, 2017
aerospike.go initial commit Jul 22, 2014
aerospike_bench_reflect_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
aerospike_bench_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
aerospike_suite_test.go Add -debug switch to allow logging at debug level in tests Aug 18, 2018
auth_mode.go Added LDAP Jul 30, 2018
batch_command.go Remove unneeded type casts Mar 31, 2018
batch_command_exists.go Remove unneeded type casts Mar 31, 2018
batch_command_get.go Remove unneeded type casts Mar 31, 2018
batch_command_get_reflect.go Fix TTL in GetObject and BatchGetObject reflection API Jun 11, 2018
batch_command_reflect.go Remove unneeded type casts Mar 31, 2018
batch_index_command_get.go Added InDoubt() method to AerospikeError Mar 8, 2018
batch_node.go CP Mode Support Mar 7, 2018
batch_policy.go Clarified the meaning of partial batch results in the comments to emp… Apr 9, 2018
batch_read.go Support new Batch Index protocol both as a new BatchGetComplex, and a… Nov 16, 2017
bench_batchget_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
bench_cdt_list_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
bench_packing_test.go Try to avoid reflection in packer as much as possible Apr 24, 2017
bench_rand_gen_test.go Update copyright dates to include 2017 Jan 11, 2017
bench_read_command_test.go Update API in the benchmark Code Apr 24, 2017
bench_values_test.go Update copyright dates to include 2017 Jan 11, 2017
bench_write_command_test.go Update copyright dates to include 2017 Jan 11, 2017
bin.go Update copyright dates to include 2017 Jan 11, 2017
bytes_buffer.go Fix go vet complaints Mar 31, 2017
cdt.go Added new CDT operations Jun 11, 2018
cdt_list.go Support Map and List WriteFlags: NoFail and Partial Jul 30, 2018
cdt_list_test.go Removed unused package Aug 29, 2018
cdt_map.go Support Map and List WriteFlags: NoFail and Partial Jul 30, 2018
cdt_map_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
client.go Introduce app_engine build tag to allow app_engine builds Jun 29, 2018
client_appengine_exclusions.go Introduce app_engine build tag to allow app_engine builds Jun 29, 2018
client_object_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
client_policy.go Support load balancers as seed node Aug 16, 2018
client_reflect.go Added additional changeset Nov 20, 2017
client_reflect_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
client_test.go Bring back the Touch send key tests Aug 18, 2018
cluster.go Fix a few go vet errors for Go 1.11 Aug 27, 2018
command.go Merge branch 'community' Aug 27, 2018
commit_policy.go Update copyright dates to include 2017 Jan 11, 2017
compat_after_go1.8.go Add tls.Config cloning compatibility for go versions prior to v1.8 wh… Apr 2, 2017
compat_before_go1.8.go Add tls.Config cloning compatibility for go versions prior to v1.8 wh… Apr 2, 2017
complex_index_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
complex_query_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
connection.go Regression fix: Avoid hashing passwords per each login and use cached… Sep 18, 2018
connection_queue.go fix typo Mar 29, 2018
consistency_level.go Improve documentation Jul 30, 2018
delete_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
deprecated_ldt.go Deprecate LDTs and remove them from the official build Oct 11, 2017
example_client_test.go Update copyright dates to include 2017 Jan 11, 2017
example_listiter_int_test.go Update copyright dates to include 2017 Jan 11, 2017
example_listiter_string_test.go Update copyright dates to include 2017 Jan 11, 2017
example_listiter_time_test.go Update copyright dates to include 2017 Jan 11, 2017
example_mapiter_test.go Update copyright dates to include 2017 Jan 11, 2017
execute_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
execute_task.go Allow Task.OnComplete() to be listened to by multiple goroutines Jun 12, 2018
exists_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
field_type.go Merge branch 'new_batch_protocol' Nov 20, 2017
filter.go Documentation Fix for a filter Apr 24, 2017
generation_policy.go Update copyright dates to include 2017 Jan 11, 2017
generics.go Remove unneeded type casts Mar 31, 2018
geo_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
host.go Use net.JoinHostPort to concat host and port instead of doing it dire… Mar 31, 2017
index_collection_type.go Update copyright dates to include 2017 Jan 11, 2017
index_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
index_type.go Update copyright dates to include 2017 Jan 11, 2017
info.go Improve concurrent tend, automate invalidation of connections Feb 8, 2017
key.go add the keyWriter back to the key Feb 15, 2017
key_bench_test.go Update copyright dates to include 2017 Jan 11, 2017
key_helper.go Fix go vet complaints Mar 31, 2017
key_reflect_test.go Removed conflicts in tests regarding the 'Not' predicate, added docum… Feb 22, 2017
key_test.go Removed conflicts in tests regarding the 'Not' predicate, added docum… Feb 22, 2017
language.go Update copyright dates to include 2017 Jan 11, 2017
load_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
login_command.go Regression fix: Avoid hashing passwords per each login and use cached… Sep 18, 2018
marshal.go Fix a few typos and improve error messages Apr 6, 2018
multi_policy.go Change default Scan/Query socketTimeout Aug 16, 2018
node.go Regression fix: Avoid hashing passwords per each login and use cached… Sep 18, 2018
node_error.go Update copyright dates to include 2017 Jan 11, 2017
node_stats.go Added more stats to the Client.Stast() Sep 1, 2017
node_test.go Close the tend connection when closing node connections Jul 18, 2017
node_validator.go Regression fix: Avoid hashing passwords per each login and use cached… Sep 18, 2018
operate_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
operation.go Allow operation to cache their content on reuse. Unexport Operation f… Apr 24, 2017
packer.go Fix tests; Improve error messages for unsupported values and types Apr 24, 2017
packer_reflect.go Update copyright dates to include 2017 Jan 11, 2017
packing_test.go Update copyright dates to include 2017 Jan 11, 2017
partition.go Embed structs instead of their pointers to save a few heap allocations Apr 24, 2017
partition_parser.go Improved merge map to work around the suspected race condition Aug 7, 2018
partitions.go Remove unused code Sep 18, 2018
peers.go Improve concurrent tend, automate invalidation of connections Feb 8, 2017
peers_parser.go Support load balancers as seed node Aug 16, 2018
policy.go fix typo Mar 29, 2018
predexp.go Make predExp interface public Sep 5, 2017
predexp_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
priority.go Update copyright dates to include 2017 Jan 11, 2017
privilege.go Update copyright dates to include 2017 Jan 11, 2017
query_aggregate_command.go Introduce app_engine build tag to allow app_engine builds Jun 29, 2018
query_aggregate_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
query_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
query_objects_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
query_policy.go Allow Streaming commands to retry unless the error occurs during pars… Mar 31, 2017
query_record_command.go Update copyright dates to include 2017 Jan 11, 2017
query_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
random_operation_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
read_command.go change debug level for minor error logging Sep 18, 2018
read_command_reflect.go Fix TTL in GetObject and BatchGetObject reflection API Jun 11, 2018
read_header_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
record.go Update copyright dates to include 2017 Jan 11, 2017
record_exists_action.go Update copyright dates to include 2017 Jan 11, 2017
recordset.go Update copyright dates to include 2017 Jan 11, 2017
recordset_test.go Removed conflicts in tests regarding the 'Not' predicate, added docum… Feb 22, 2017
replica_policy.go Added SEQUENCE to replica policies Sep 1, 2017
role.go Update copyright dates to include 2017 Jan 11, 2017
scan_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
scan_ldt_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
scan_objects_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
scan_policy.go Change default Scan/Query socketTimeout Aug 16, 2018
scan_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
security_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
server_command.go Remove unneeded type casts Mar 31, 2018
single_command.go Embed structs instead of their pointers to save a few heap allocations Apr 24, 2017
statement.go Make predExp interface public Sep 5, 2017
task.go Use pointer receiver for AerospikeError.SetInDoubt and AerospikeError… Aug 22, 2018
task_drop_index.go Allow Task.OnComplete() to be listened to by multiple goroutines Jun 12, 2018
task_index.go Allow Task.OnComplete() to be listened to by multiple goroutines Jun 12, 2018
task_register.go Allow Task.OnComplete() to be listened to by multiple goroutines Jun 12, 2018
task_remove.go Allow Task.OnComplete() to be listened to by multiple goroutines Jun 12, 2018
test_utils_test.go Added generic slice and map types in NewValue method to avoid hitting… Apr 3, 2017
touch_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
truncate_test.go Merge branch 'community' Aug 27, 2018
udf.go better code comments in line with godoc requirements Oct 16, 2014
udf_test.go Clean up tests and allow the user to define the namespace for tests t… Aug 16, 2018
unpacker.go Handle extension marker in List headers Apr 13, 2018
user_roles.go Update copyright dates to include 2017 Jan 11, 2017
value.go Fix tests; Improve error messages for unsupported values and types Apr 24, 2017
value_helpers.go Added generic slice and map types in NewValue method to avoid hitting… Apr 3, 2017
value_reflect.go Update copyright dates to include 2017 Jan 11, 2017
value_test.go Removed conflicts in tests regarding the 'Not' predicate, added docum… Feb 22, 2017
write_command.go Added InDoubt() method to AerospikeError Mar 8, 2018
write_policy.go Minor doc fix May 14, 2018

README.md

Aerospike Go Client

Aerospike Client Go

An Aerospike library for Go.

This library is compatible with Go 1.7+ and supports the following operating systems: Linux, Mac OS X (Windows builds are possible, but untested)

Please refer to CHANGELOG.md if you encounter breaking changes.

Usage:

The following is a very simple example of CRUD operations in an Aerospike database.

package main

import (
  "fmt"

  . "github.com/aerospike/aerospike-client-go"
)

func panicOnError(err error) {
  if err != nil {
    panic(err)
  }
}

func main() {
  // define a client to connect to
  client, err := NewClient("127.0.0.1", 3000)
  panicOnError(err)

  key, err := NewKey("test", "aerospike", "key")
  panicOnError(err)

  // define some bins with data
  bins := BinMap{
    "bin1": 42,
    "bin2": "An elephant is a mouse with an operating system",
    "bin3": []interface{}{"Go", 2009},
  }

  // write the bins
  err = client.Put(nil, key, bins)
  panicOnError(err)

  // read it back!
  rec, err := client.Get(nil, key)
  panicOnError(err)

  fmt.Printf("%#v\n", *rec)

  // delete the key, and check if key exists
  existed, err := client.Delete(nil, key)
  panicOnError(err)
  fmt.Printf("Record existed before delete? %v\n", existed)
}

More examples illustrating the use of the API are located in the examples directory.

Details about the API are available in the docs directory.

Prerequisites

Go version v1.7+ is required.

To install the latest stable version of Go, visit 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.

Supported operating systems:

  • Major Linux distributions (Ubuntu, Debian, Red Hat)
  • Mac OS X
  • Windows (untested)

Installation:

  1. Install Go 1.7+ and setup your environment as Documented here.
  2. Get the client in your GOPATH : go get github.com/aerospike/aerospike-client-go
  • To update the client library: go get -u github.com/aerospike/aerospike-client-go

Using gopkg.in is also supported: go get -u gopkg.in/aerospike/aerospike-client-go.v1

Some Hints:

  • To run a go program directly: go run <filename.go>
  • to build: go build -o <output> <filename.go>
  • example: go build -o benchmark tools/benchmark/benchmark.go

Performance Tweaking

We are bending all efforts to improve the client's performance. In our reference benchmarks, Go client performs almost as good as the C client.

To read about performance variables, please refer to docs/performance.md

Tests

This library is packaged with a number of tests. Tests require Ginkgo and Gomega library.

Before running the tests, you need to update the dependencies:

$ go get .

To run all the test cases with race detection:

$ ginkgo -r -race

Examples

A variety of example applications are provided in the examples directory.

Tools

A variety of clones of original tools are provided in the tools directory. They show how to use more advanced features of the library to reimplement the same functionality in a more concise way.

Benchmarks

Benchmark utility is provided in the tools/benchmark directory. See the tools/benchmark/README.md for details.

API Documentation

API documentation is available in the docs directory.

License

The Aerospike Go Client is made available under the terms of the Apache License, Version 2, as stated in the file LICENSE.

Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.