Install the Aerospike client
For the complete documentation index see: llms.txt
All documentation pages available in markdown.
Prerequisites
- Go version 1.23 or later.
To install Go, see the Go downloads page. Your package manager may also have go. To see if go is installed and working, run go version.
The Aerospike Go client implements the Aerospike network protocols in pure Go, and does not depend on the C client. It is goroutine-safe.
Supported operating systems:
- Major Linux distributions (Ubuntu, Debian, Red Hat, Amazon)
- macOS
- Windows (untested)
Installation
-
Install Go 1.23 or later. See the Go documentation. To confirm that Go is installed and working, run
go versionat the command line. -
From a Go module, fetch the Aerospike Go client:
Terminal window go get github.com/aerospike/aerospike-client-go/v8 -
Update the client library:
Terminal window go get -u github.com/aerospike/aerospike-client-go/v8
Verify
From your module, confirm the client is on the module graph:
go list github.com/aerospike/aerospike-client-go/v8The command prints the module path, which confirms the client resolved:
github.com/aerospike/aerospike-client-go/v8If the module is missing, the command fails with a no required module provides package error. Run go get github.com/aerospike/aerospike-client-go/v8 again from inside the module directory.
Testing
The Ginkgo test suite is optional. You do not need it to install or use the client. Run the tests from a clone of aerospike-client-go, not from $GOPATH. The tests use Go modules and Ginkgo v2.
:::danger Destroys data in the target namespace
The test suite is destructive. It creates and drops secondary indexes and truncates entire namespaces, not just the sets it creates. The namespace defaults to test, so every record in the target cluster’s test namespace is deleted.
Point the tests only at a dedicated, empty database that holds no data you need. Never run them against a production cluster, and never against a cluster whose test namespace holds real data. Truncation cannot be undone.
:::
Install the test runner and download module dependencies:
go install github.com/onsi/ginkgo/v2/ginkgo@latestgo get github.com/onsi/ginkgo/v2go get github.com/onsi/gomegago get .A running Aerospike Database is required. To run all test cases with race detection:
ginkgo -r -race -- -h 127.0.0.1 -p 3000Next steps
See Connecting.