GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aerospike/aerospike-client-go: Aerospike Client Go

BranchesTags
Open more actions menu

Latest commit

 

History

1,816 Commits
1,816 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude/skills/cut-release
.claude/skills/cut-release
 
 
.github
.github
 
 
config
config
 
 
docs
docs
 
 
examples
examples
 
 
internal
internal
 
 
logger
logger
 
 
pkg
pkg
 
 
test/resources
test/resources
 
 
tools
tools
 
 
types
types
 
 
utils/buffer
utils/buffer
 
 
.build.yml
.build.yml
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.testcoverage.yml
.testcoverage.yml
 
 
.tool-versions
.tool-versions
 
 
AI_PIPELINE.md
AI_PIPELINE.md
 
 
AI_VALIDATIONS.yaml
AI_VALIDATIONS.yaml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
abort_status.go
abort_status.go
 
 
admin_command.go
admin_command.go
 
 
admin_policy.go
admin_policy.go
 
 
aerospike.go
aerospike.go
 
 
aerospike_bench_reflect_test.go
aerospike_bench_reflect_test.go
 
 
aerospike_bench_test.go
aerospike_bench_test.go
 
 
aerospike_suite_test.go
aerospike_suite_test.go
 
 
anonymous_fields_test.go
anonymous_fields_test.go
 
 
auth_mode.go
auth_mode.go
 
 
base_read_command.go
base_read_command.go
 
 
base_write_command.go
base_write_command.go
 
 
batch_attr.go
batch_attr.go
 
 
batch_command.go
batch_command.go
 
 
batch_command_delete.go
batch_command_delete.go
 
 
batch_command_exists.go
batch_command_exists.go
 
 
batch_command_get.go
batch_command_get.go
 
 
batch_command_get_reflect.go
batch_command_get_reflect.go
 
 
batch_command_indoubt_multinode_test.go
batch_command_indoubt_multinode_test.go
 
 
batch_command_indoubt_test.go
batch_command_indoubt_test.go
 
 
batch_command_operate.go
batch_command_operate.go
 
 
batch_command_reflect.go
batch_command_reflect.go
 
 
batch_command_udf.go
batch_command_udf.go
 
 
batch_delete.go
batch_delete.go
 
 
batch_delete_policy.go
batch_delete_policy.go
 
 
batch_delete_policy_config_test.go
batch_delete_policy_config_test.go
 
 
batch_execute_single_test.go
batch_execute_single_test.go
 
 
batch_executer.go
batch_executer.go
 
 
batch_index_command_get.go
batch_index_command_get.go
 
 
batch_node.go
batch_node.go
 
 
batch_node_list.go
batch_node_list.go
 
 
batch_offsets.go
batch_offsets.go
 
 
batch_policy.go
batch_policy.go
 
 
batch_read.go
batch_read.go
 
 
batch_read_policy.go
batch_read_policy.go
 
 
batch_read_policy_config_test.go
batch_read_policy_config_test.go
 
 
batch_read_repeat_optimisation_test.go
batch_read_repeat_optimisation_test.go
 
 
batch_record.go
batch_record.go
 
 
batch_test.go
batch_test.go
 
 
batch_udf.go
batch_udf.go
 
 
batch_udf_policy.go
batch_udf_policy.go
 
 
batch_udf_policy_config_test.go
batch_udf_policy_config_test.go
 
 
batch_write.go
batch_write.go
 
 
batch_write_policy.go
batch_write_policy.go
 
 
batch_write_policy_config_test.go
batch_write_policy_config_test.go
 
 
bench_apply_configuration_test.go
bench_apply_configuration_test.go
 
 
bench_apply_metrics_test.go
bench_apply_metrics_test.go
 
 
bench_apply_transaction_metrics_test.go
bench_apply_transaction_metrics_test.go
 
 
bench_batchget_test.go
bench_batchget_test.go
 
 
bench_cdt_list_test.go
bench_cdt_list_test.go
 
 
bench_get_test.go
bench_get_test.go
 
 
bench_interface_allocs_test.go
bench_interface_allocs_test.go
 
 
bench_key_test.go
bench_key_test.go
 
 
bench_map_test.go
bench_map_test.go
 
 
bench_packing_test.go
bench_packing_test.go
 
 
bench_rand_gen_test.go
bench_rand_gen_test.go
 
 
bench_read_command_test.go
bench_read_command_test.go
 
 
bench_recordset_test.go
bench_recordset_test.go
 
 
bench_utf8_validate_test.go
bench_utf8_validate_test.go
 
 
bench_values_test.go
bench_values_test.go
 
 
bench_write_command_test.go
bench_write_command_test.go
 
 
bin.go
bin.go
 
 
bin_name_empty_test.go
bin_name_empty_test.go
 
 
bit_overflow_action.go
bit_overflow_action.go
 
 
bit_policy.go
bit_policy.go
 
 
bit_resize_flags.go
bit_resize_flags.go
 
 
bit_write_flags.go
bit_write_flags.go
 
 
buffered_connection.go
buffered_connection.go
 
 
bytes_buffer.go
bytes_buffer.go
 
 
cdt.go
cdt.go
 
 
cdt_bitwise.go
cdt_bitwise.go
 
 
cdt_bitwise_test.go
cdt_bitwise_test.go
 
 
cdt_context.go
cdt_context.go
 
 
cdt_context_test.go
cdt_context_test.go
 
 
cdt_list.go
cdt_list.go
 
 
cdt_list_test.go
cdt_list_test.go
 
 
cdt_map.go
cdt_map.go
 
 
cdt_map_test.go
cdt_map_test.go
 
 
cdt_operation.go
cdt_operation.go
 
 

Repository files navigation

Aerospike Go Client v8

Aerospike Client Go Godoc Tests

An Aerospike library for Go.

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.

You can refer to the test files for idiomatic use cases.

Please refer to CHANGELOG.md for release notes, or if you encounter breaking changes.

  • Aerospike Go Client v8
    • Usage
    • Prerequisites
    • Installation
      • Some Tips
    • Performance Tweaking
    • Tests
    • Examples
      • Tools
    • Benchmarks
    • API Documentation
    • Google App Engine
    • Reflection, and Object API
    • License

Usage

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

package main

import (
  "fmt"

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

// This is only for this example.
// Please handle errors properly.
func panicOnError(err error) {
  if err != nil {
    panic(err)
  }
}

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

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

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

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

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

  // 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.23+ 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.23+ as documented.
  2. From a Go module, get the client: 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 Tips

  • To run a go program directly: go run <filename.go>
  • to build: go build -o <output> <filename.go>
  • example: go build -tags as_performance -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 v2 and Gomega.

From a clone of this repository, update dependencies and install the test runner:

$ go install github.com/onsi/ginkgo/v2/ginkgo@latest
$ go get .

A running Aerospike Database is required. To run all test cases with race detection:

$ ginkgo -r -race -- -h 127.0.0.1 -p 3000

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 re-implement 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

A simple API documentation is available in the docs directory. The latest up-to-date docs can be found in Godoc.

Google App Engine

To build the library for App Engine, build it with the build tag app_engine. Aggregation functionality is not available in this build.

Reflection, and Object API

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.

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.

About

Aerospike Client Go

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Security policy

Security policy
Activity
Custom properties

Stars

459 stars

Watchers

68 watching

Forks

215 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.