Categorygithub.com/stackadapt/aerospike-client-go
modulepackage
4.5.2+incompatible
Repository: https://github.com/stackadapt/aerospike-client-go.git
Documentation: pkg.go.dev

# README

Aerospike Go Client

Aerospike Client Go Build Status Godoc

IMPORTANT NOTE

This is an old version the Aerospike Go Client, which is v4.x.x. The newest version v5 has migrated to go modules, which required us to put it in the v5 branch here. All the latest changes to the library are applied in that branch, documented in the CHANGELOG.


Official Aerospike Client library for Go.

This library is compatible with Go 1.9+ 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.

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"
)

// 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": []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)

  // 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.12+ 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.9+ 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 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.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AddOp creates integer add database operation.
AppendOp creates string append database operation.
BitAddOp creates bit "add" operation.
BitAndOp creates bit "and" operation.
BitCountOp creates bit "count" operation.
BitGetIntOp creates bit "get integer" operation.
BitGetOp creates bit "get" operation.
BitInsertOp creates byte "insert" operation.
BitLScanOp creates bit "left scan" operation.
BitLShiftOp creates bit "left shift" operation.
BitNotOp creates bit "not" operation.
BitOrOp creates bit "or" operation.
BitRemoveOp creates byte "remove" operation.
BitResizeOp creates byte "resize" operation.
BitRScanOp creates bit "right scan" operation.
BitRShiftOp creates bit "right shift" operation.
BitSetIntOp creates bit "setInt" operation.
BitSetOp creates bit "set" operation.
BitSubtractOp creates bit "subtract" operation.
BitXorOp creates bit "exclusive or" operation.
CtxListIndex defines Lookup list by index offset.
CtxListIndexCreate list with given type at index offset, given an order and pad.
CtxListRank defines Lookup list by rank.
CtxListValue defines Lookup list by value.
CtxMapIndex defines Lookup map by index offset.
CtxMapKey defines Lookup map by key.
CtxMapKeyCreate creates map with given type at map key.
CtxMapRank defines Lookup map by rank.
CtxMapValue defines Lookup map by value.
DefaultBitPolicy will return the default BitPolicy.
DefaultHLLPolicy uses the default policy when performing HLL operations.
DefaultListPolicy returns the default policy for CDT list operations.
DefaultMapPolicy returns the default map policy.
DeleteOp creates delete record database operation.
ExpAnd creates a "and" (&&) operator that applies to a variable number of expressions.
ExpBinExists creates a function that returns if bin of specified name exists.
ExpBinType creates a function that returns bin's integer particle type.
ExpBitAdd creates an expression that adds value to byte[] bin starting at bitOffset for bitSize and returns byte[].
ExpBitAnd creates an expression that performs bitwise "and" on value and byte[] bin at bitOffset for bitSize and returns byte[].
ExpBitCount creates an expression that returns integer count of set bits from byte[] bin starting at bitOffset for bitSize.
ExpBitGet creates an expression that returns bits from byte[] bin starting at bitOffset for bitSize.
ExpBitGetInt Create expression that returns integer from byte[] bin starting at bitOffset for bitSize.
ExpBitInsert creates an expression that inserts value bytes into byte[] bin at byteOffset and returns byte[].
ExpBitLScan creates an expression that returns integer bit offset of the first specified value bit in byte[] bin starting at bitOffset for bitSize.
ExpBitLShift creates an expression that shifts left byte[] bin starting at bitOffset for bitSize and returns byte[].
ExpBitNot creates an expression that negates byte[] bin starting at bitOffset for bitSize and returns byte[].
ExpBitOr creates an expression that performs bitwise "or" on value and byte[] bin at bitOffset for bitSize and returns byte[].
ExpBitRemove creates an expression that removes bytes from byte[] bin at byteOffset for byteSize and returns byte[].
ExpBitResize creates an expression that resizes byte[] to byteSize according to resizeFlags and returns byte[].
ExpBitRScan creates an expression that returns integer bit offset of the last specified value bit in byte[] bin starting at bitOffset for bitSize.
ExpBitRShift creates an expression that shifts right byte[] bin starting at bitOffset for bitSize and returns byte[].
ExpBitSet creates an expression that sets value on byte[] bin at bitOffset for bitSize and returns byte[].
ExpBitSetInt creates an expression that sets value to byte[] bin starting at bitOffset for bitSize and returns byte[].
ExpBitSubtract creates an expression that subtracts value from byte[] bin starting at bitOffset for bitSize and returns byte[].
ExpBitXor creates an expression that performs bitwise "xor" on value and byte[] bin at bitOffset for bitSize and returns byte[].
ExpBlobBin creates a blob bin expression.
ExpBlobVal creates a Blob bin value.
ExpBoolVal creates a Boolean value.
ExpDeviceSize creates a function that returns record size on disk.
ExpDigestModulo creates a function that returns record digest modulo as integer.
ExpEq creates a equal (==) expression.
ExpFloatBin creates a 64 bit float bin expression.
ExpFloatVal creates a 64 bit float bin value.
ExpGeoBin creates a geo bin expression.
ExpGeoCompare creates a compare geospatial operation.
ExpGeoVal creates a geospatial json string value.
ExpGreater creates a greater than (>) operation.
ExpGreaterEq creates a greater than or equal (>=) operation.
ExpHLLAdd creates an expression that adds list values to a HLL set and returns HLL set.
ExpHLLAddWithIndex creates an expression that adds values to a HLL set and returns HLL set.
ExpHLLAddWithIndexAndMinHash creates an expression that adds values to a HLL set and returns HLL set.
ExpHLLBin creates a a HLL bin expression.
ExpHLLDescribe creates an expression that returns `indexBitCount` and `minHashBitCount` used to create HLL bin in a list of longs.
ExpHLLGetCount creates an expression that returns estimated number of elements in the HLL bin.
ExpHLLGetIntersectCount creates an expression that returns estimated number of elements that would be contained by the intersection of these HLL objects.
ExpHLLGetSimilarity creates an expression that returns estimated similarity of these HLL objects as a 64 bit float.
ExpHLLGetUnion creates an expression that returns a HLL object that is the union of all specified HLL objects in the list with the HLL bin.
ExpHLLGetUnionCount creates an expression that returns estimated number of elements that would be contained by the union of these HLL objects.
ExpHLLMayContain creates an expression that returns one if HLL bin may contain all items in the list.
ExpIntBin creates a 64 bit int bin expression.
ExpIntVal creates a 64 bit integer value.
ExpIsTombstone creates a expression that returns if record has been deleted and is still in tombstone state.
ExpKey creates a record key expression of specified type.
ExpKeyExists creates a function that returns if the primary key is stored in the record meta data as a boolean expression.
ExpLastUpdate creates a function that returns record last update time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.
ExpLess creates a less than (<) operation.
ExpLessEq creates a less than or equals (<=) operation.
ExpListAppend creates an expression that appends value to end of list.
ExpListAppendItems creates an expression that appends list items to end of list.
ExpListBin creates a list bin expression.
ExpListClear creates an expression that removes all items in list.
ExpListGetByIndex creates an expression that selects list item identified by index and returns selected data specified by returnType.
ExpListGetByIndexRange creates an expression that selects list items starting at specified index to the end of list and returns selected data specified by returnType .
ExpListGetByIndexRangeCount creates an expression that selects "count" list items starting at specified index and returns selected data specified by returnType.
ExpListGetByRank creates an expression that selects list item identified by rank and returns selected data specified by returnType.
ExpListGetByRankRange creates an expression that selects list items starting at specified rank to the last ranked item and returns selected data specified by returnType.
ExpListGetByRankRangeCount creates an expression that selects "count" list items starting at specified rank and returns selected data specified by returnType.
ExpListGetByValue creates an expression that selects list items identified by value and returns selected data specified by returnType.
ExpListGetByValueList creates an expression that selects list items identified by values and returns selected data specified by returnType.
ExpListGetByValueRange creates an expression that selects list items identified by value range and returns selected data specified by returnType.
ExpListGetByValueRelativeRankRange creates an expression that selects list items nearest to value and greater by relative rank and returns selected data specified by returnType.
ExpListGetByValueRelativeRankRangeCount creates an expression that selects list items nearest to value and greater by relative rank with a count limit and returns selected data specified by returnType.
ExpListIncrement creates an expression that increments `list[index]` by value.
ExpListInsert creates an expression that inserts value to specified index of list.
ExpListInsertItems creates an expression that inserts each input list item starting at specified index of list.
ExpListRemoveByIndex creates an expression that removes list item identified by index.
ExpListRemoveByIndexRange creates an expression that removes list items starting at specified index to the end of list.
ExpListRemoveByIndexRangeCount creates an expression that removes "count" list items starting at specified index.
ExpListRemoveByRank creates an expression that removes list item identified by rank.
ExpListRemoveByRankRange creates an expression that removes list items starting at specified rank to the last ranked item.
ExpListRemoveByRankRangeCount creates an expression that removes "count" list items starting at specified rank.
ExpListRemoveByValue creates an expression that removes list items identified by value.
ExpListRemoveByValueList creates an expression that removes list items identified by values.
ExpListRemoveByValueRange creates an expression that removes list items identified by value range (valueBegin inclusive, valueEnd exclusive).
ExpListRemoveByValueRelativeRankRange creates an expression that removes list items nearest to value and greater by relative rank.
ExpListRemoveByValueRelativeRankRangeCount creates an expression that removes list items nearest to value and greater by relative rank with a count limit.
ExpListSet creates an expression that sets item value at specified index in list.
ExpListSize creates an expression that returns list size.
ExpListSort creates an expression that sorts list according to sortFlags.
ExpListVal creates a List bin Value.
ExpListValueVal creates a List bin Value.
ExpMapBin creates a map bin expression.
ExpMapClear creates an expression that removes all items in map.
ExpMapGetByIndex creates an expression that selects map item identified by index and returns selected data specified by returnType.
ExpMapGetByIndexRange creates an expression that selects map items starting at specified index to the end of map and returns selected data specified by returnType.
ExpMapGetByIndexRangeCount creates an expression that selects "count" map items starting at specified index and returns selected data specified by returnType.
ExpMapGetByKey creates an expression that selects map item identified by key and returns selected data specified by returnType.
ExpMapGetByKeyList creates an expression that selects map items identified by keys and returns selected data specified by returnType.
ExpMapGetByKeyRange creates an expression that selects map items identified by key range (keyBegin inclusive, keyEnd exclusive).
ExpMapGetByKeyRelativeIndexRange creates an expression that selects map items nearest to key and greater by index.
ExpMapGetByKeyRelativeIndexRangeCount creates an expression that selects map items nearest to key and greater by index with a count limit.
ExpMapGetByRank creates an expression that selects map item identified by rank and returns selected data specified by returnType.
ExpMapGetByRankRange creates an expression that selects map items starting at specified rank to the last ranked item and returns selected data specified by returnType.
ExpMapGetByRankRangeCount creates an expression that selects "count" map items starting at specified rank and returns selected data specified by returnType.
ExpMapGetByValue creates an expression that selects map items identified by value and returns selected data specified by returnType.
ExpMapGetByValueList creates an expression that selects map items identified by values and returns selected data specified by returnType.
ExpMapGetByValueRange creates an expression that selects map items identified by value range (valueBegin inclusive, valueEnd exclusive) If valueBegin is null, the range is less than valueEnd.
ExpMapGetByValueRelativeRankRange creates an expression that selects map items nearest to value and greater by relative rank.
ExpMapGetByValueRelativeRankRangeCount creates an expression that selects map items nearest to value and greater by relative rank with a count limit.
ExpMapIncrement creates an expression that increments values by incr for all items identified by key.
ExpMapPut creates an expression that writes key/value item to map bin.
ExpMapPutItems creates an expression that writes each map item to map bin.
ExpMapRemoveByIndex creates an expression that removes map item identified by index.
ExpMapRemoveByIndexRange creates an expression that removes map items starting at specified index to the end of map.
ExpMapRemoveByIndexRangeCount creates an expression that removes "count" map items starting at specified index.
ExpMapRemoveByKey creates an expression that removes map item identified by key.
ExpMapRemoveByKeyList creates an expression that removes map items identified by keys.
ExpMapRemoveByKeyRange creates an expression that removes map items identified by key range (keyBegin inclusive, keyEnd exclusive).
ExpMapRemoveByKeyRelativeIndexRange creates an expression that removes map items nearest to key and greater by index.
ExpMapRemoveByKeyRelativeIndexRangeCount creates an expression that removes map items nearest to key and greater by index with a count limit.
ExpMapRemoveByRank creates an expression that removes map item identified by rank.
ExpMapRemoveByRankRange creates an expression that removes map items starting at specified rank to the last ranked item.
ExpMapRemoveByRankRangeCount creates an expression that removes "count" map items starting at specified rank.
ExpMapRemoveByValue creates an expression that removes map items identified by value.
ExpMapRemoveByValueList creates an expression that removes map items identified by values.
ExpMapRemoveByValueRange creates an expression that removes map items identified by value range (valueBegin inclusive, valueEnd exclusive).
ExpMapRemoveByValueRelativeRankRange creates an expression that removes map items nearest to value and greater by relative rank.
ExpMapRemoveByValueRelativeRankRangeCount creates an expression that removes map items nearest to value and greater by relative rank with a count limit.
ExpMapSize creates an expression that returns list size.
ExpMapVal creates a Map bin Value.
ExpMemorySize creates expression that returns record size in memory.
ExpNilValue creates a a Nil Value.
ExpNot creates a "not" operator expression.
ExpNotEq creates a not equal (!=) expression.
ExpOr creates a "or" (||) operator that applies to a variable number of expressions.
ExpRegexCompare creates a function like regular expression string operation.
ExpSetName creates a function that returns record set name string.
ExpSinceUpdate creates a expression that returns milliseconds since the record was last updated.
ExpStringBin creates a string bin expression.
ExpStringVal creates a String bin value.
ExpTTL creates a function that returns record expiration time (time to live) in integer seconds.
ExpValueArrayVal creates a List bin Value.
ExpVoidTime creates a function that returns record expiration time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.
GetHeaderOp creates read record header database operation.
GetNodeBatchRead returns a node for batch reads.
GetOp creates read all record bins database operation.
GetOpForBin creates read bin database operation.
GetReplicaPolicySC returns a ReplicaPolicy based on different variables in SC mode.
HLLAddOp creates HLL add operation with minhash bits.
HLLDescribeOp creates HLL describe operation.
HLLFoldOp creates HLL fold operation.
HLLGetCountOp creates HLL getCount operation.
HLLGetIntersectCountOp creates HLL getIntersectCount operation.
HLLGetSimilarityOp creates HLL getSimilarity operation.
HLLGetUnionCountOp creates HLL getUnionCount operation.
HLLGetUnionOp creates HLL getUnion operation.
HLLInitOp creates HLL init operation with minhash bits.
HLLRefreshCountOp creates HLL refresh operation.
HLLSetUnionOp creates HLL set union operation.
ListAppendOp creates a list append operation.
ListAppendWithPolicyContextOp creates a list append operation.
ListAppendWithPolicyOp creates a list append operation.
ListClearOp creates a list clear operation.
ListCreateOp creates list create operation.
ListGetByIndexOp creates list get by index operation.
ListGetByIndexRangeCountOp creates list get by index range operation.
ListGetByIndexRangeOp creates list get by index range operation.
ListGetByRankOp creates a list get by rank operation.
ListGetByRankRangeCountOp creates a list get by rank range operation.
ListGetByRankRangeOp creates a list get by rank range operation.
ListGetByValueListOp creates list get by value list operation.
ListGetByValueOp creates a list get by value operation.
ListGetByValueRangeOp creates a list get by value range operation.
ListGetByValueRelativeRankRangeCountOp creates a list get by value relative to rank range operation.
ListGetByValueRelativeRankRangeOp creates a list get by value relative to rank range operation.
ListGetOp creates a list get operation.
ListGetRangeFromOp creates a list get range operation.
ListGetRangeOp creates a list get range operation.
ListIncrementByOneOp creates list increment operation with policy.
ListIncrementByOneWithPolicyOp creates list increment operation with policy.
ListIncrementOp creates a list increment operation.
ListIncrementWithPolicyOp creates a list increment operation.
ListInsertOp creates a list insert operation.
ListInsertWithPolicyContextOp creates a list insert operation.
ListInsertWithPolicyOp creates a list insert operation.
ListPopOp creates list pop operation.
ListPopRangeFromOp creates a list pop range operation.
ListPopRangeOp creates a list pop range operation.
ListRemoveByIndexOp creates a list remove operation.
ListRemoveByIndexRangeCountOp creates a list remove operation.
ListRemoveByIndexRangeOp creates a list remove operation.
ListRemoveByRankOp creates a list remove operation.
ListRemoveByRankRangeCountOp creates a list remove operation.
ListRemoveByRankRangeOp creates a list remove operation.
ListRemoveByValueListOp creates list remove by value operation.
ListRemoveByValueOp creates list remove by value operation.
ListRemoveByValueRangeOp creates a list remove operation.
ListRemoveByValueRelativeRankRangeCountOp creates a list remove by value relative to rank range operation.
ListRemoveByValueRelativeRankRangeOp creates a list remove by value relative to rank range operation.
ListRemoveOp creates a list remove operation.
ListRemoveRangeFromOp creates a list remove range operation.
ListRemoveRangeOp creates a list remove range operation.
ListSetOp creates a list set operation.
ListSetOrderOp creates a set list order operation.
ListSizeOp creates a list size operation.
ListSortOp creates list sort operation.
ListTrimOp creates a list trim operation.
MapClearOp creates map clear operation.
MapCreateOp creates a map create operation.
MapDecrementOp creates map decrement operation.
MapGetByIndexOp creates map get by index operation.
MapGetByIndexRangeCountOp creates map get by index range operation.
MapGetByIndexRangeOp creates map get by index range operation.
MapGetByKeyListOp creates a map get by key list operation.
MapGetByKeyOp creates map get by key operation.
MapGetByKeyRangeOp creates map get by key range operation.
MapGetByKeyRelativeIndexRangeCountOp creates a map get by key relative to index range operation.
MapGetByKeyRelativeIndexRangeOp creates a map get by key relative to index range operation.
MapGetByRankOp creates map get by rank operation.
MapGetByRankRangeCountOp creates map get by rank range operation.
MapGetByRankRangeOp creates map get by rank range operation.
MapGetByValueListOp creates map get by value list operation.
MapGetByValueOp creates map get by value operation.
MapGetByValueRangeOp creates map get by value range operation.
MapGetByValueRelativeRankRangeCountOp creates a map get by value relative to rank range operation.
MapGetByValueRelativeRankRangeOp creates a map get by value relative to rank range operation.
MapIncrementOp creates map increment operation.
MapPutItemsOp creates map put items operation Server writes each map item to map bin and returns map size.
MapPutOp creates map put operation.
MapRemoveByIndexOp creates map remove operation.
MapRemoveByIndexRangeCountOp creates map remove operation.
MapRemoveByIndexRangeOp creates map remove operation.
MapRemoveByKeyListOp creates map remove operation.
MapRemoveByKeyOp creates map remove operation.
MapRemoveByKeyRangeOp creates map remove operation.
MapRemoveByKeyRelativeIndexRangeCountOp creates map remove by key relative to index range operation.
MapRemoveByKeyRelativeIndexRangeOp creates a map remove by key relative to index range operation.
MapRemoveByRankOp creates map remove operation.
MapRemoveByRankRangeCountOp creates map remove operation.
MapRemoveByRankRangeOp creates map remove operation.
MapRemoveByValueListOp creates map remove operation.
MapRemoveByValueOp creates map remove operation.
MapRemoveByValueRangeOp creates map remove operation.
MapRemoveByValueRelativeRankRangeCountOp creates a map remove by value relative to rank range operation.
MapRemoveByValueRelativeRankRangeOp creates a map remove by value relative to rank range operation.
MapSetPolicyOp creates set map policy operation.
MapSizeOp creates map size operation.
NewAdminPolicy generates a new AdminPolicy with default values.
NewBatchPolicy initializes a new BatchPolicy instance with default parameters.
NewBatchRead defines a key and bins to retrieve in a batch operation.
NewBatchReadHeader defines a key to retrieve the record headers only in a batch operation.
NewBin generates a new Bin instance, specifying bin name and string value.
NewBitPolicy will return a BitPolicy will provided flags.
NewBlobValue accepts an AerospikeBlob interface, and automatically converts it to a BytesValue.
NewBytesValue generates a ByteValue instance.
NewClient generates a new Client instance.
NewClientPolicy generates a new ClientPolicy with default values.
NewClientWithPolicy generates a new Client using the specified ClientPolicy.
NewClientWithPolicyAndHost generates a new Client the specified ClientPolicy and sets up the cluster using the provided hosts.
NewCluster generates a Cluster instance.
NewConnection creates a TLS connection on the network and returns the pointer.
NewContainsFilter creates a contains filter for query on collection index.
NewContainsRangeFilter creates a contains filter for query on ranges of data in a collection index.
NewDropIndexTask initializes a task with fields needed to query server nodes.
NewEqualFilter creates a new equality filter instance for query.
NewExecuteTask initializes task with fields needed to query server nodes.
NewFloatValue generates a FloatValue instance.
NewGeoJSONValue generates a GeoJSONValue instance.
NewGeoRegionsContainingPointFilter creates a geospatial "containing point" filter for query.
NewGeoRegionsContainingPointForCollectionFilter creates a geospatial "containing point" filter for query on collection index.
NewGeoWithinRadiusFilter creates a geospatial "within radius" filter for query.
NewGeoWithinRadiusForCollectionFilter creates a geospatial "within radius" filter for query on collection index.
NewGeoWithinRegionFilter creates a geospatial "within region" filter for query.
NewGeoWithinRegionForCollectionFilter creates a geospatial "within region" filter for query on collection index.
NewHLLPolicy uses specified HLLWriteFlags when performing HLL operations.
NewHLLValue generates a ByteValue instance.
NewHost initializes new host instance.
NewHosts initializes new host instances by a passed slice of addresses.
NewIndexTask initializes a task with fields needed to query server nodes.
NewInfinityValue generates a InfinityValue instance.
NewInfoPolicy generates a new InfoPolicy with default values.
NewIntegerValue generates an IntegerValue instance.
NewJsonValue generates a JsonValue instance.
NewKey initializes a key from namespace, optional set name and user key.
NewKeyWithDigest initializes a key from namespace, optional set name and user key.
NewListerValue generates a NewListerValue instance.
NewListPolicy creates a policy with directives when creating a list and writing list items.
NewListValue generates a ListValue instance.
NewLongValue generates a LongValue instance.
NewMapperValue generates a MapperValue instance.
NewMapPolicy creates a MapPolicy with WriteMode.
NewMapPolicyWithFlags creates a MapPolicy with WriteFlags.
NewMapValue generates a MapValue instance.
NewMultiPolicy initializes a MultiPolicy instance with default values.
NewNullValue generates a NullValue instance.
NewPartition returns a partition representation.
NewPartitionFilterAll creates a partition filter that reads all the partitions.
NewPartitionFilterById creates a partition filter by partition id.
NewPartitionFilterByKey creates a partition filter that will return records after key's digest in the partition containing the digest.
NewPartitionFilterByRange creates a partition filter by partition range.
NewPolicy generates a new BasePolicy instance with default values.
NewPredExpAnd creates an AND predicate.
NewPredExpGeoJSONBin creates a Bin predicate expression which its type is GeoJSON.
NewPredExpGeoJSONContains creates Region Contains predicate for GeoJSON values.
NewPredExpGeoJSONValue embeds a GeoJSON value in a predicate expression.
NewPredExpGeoJSONVar creates GeoJSON variable used in list/map iterations.
NewPredExpGeoJSONWithin creates Within Region predicate for GeoJSON values.
NewPredExpIntegerBin creates a Bin predicate expression which its type is integer.
NewPredExpIntegerEqual creates Equal predicate for integer values.
NewPredExpIntegerGreater creates Greater Than predicate for integer values.
NewPredExpIntegerGreaterEq creates Greater Than Or Equal predicate for integer values.
NewPredExpIntegerLess creates Less Than predicate for integer values.
NewPredExpIntegerLessEq creates Less Than Or Equal predicate for integer values.
NewPredExpIntegerUnequal creates NotEqual predicate for integer values.
NewPredExpIntegerValue embeds an int64 value in a predicate expression.
NewPredExpIntegerVar creates 64 bit integer variable used in list/map iterations.
NewPredExpListBin creates a Bin predicate expression which its type is List.
NewPredExpListIterateAnd creates an And iterator predicate for list items.
NewPredExpListIterateOr creates an Or iterator predicate for list items.
NewPredExpMapBin creates a Bin predicate expression which its type is Map.
NewPredExpMapKeyIterateAnd creates an And iterator predicate on map keys.
NewPredExpMapKeyIterateOr creates an Or iterator predicate on map keys.
NewPredExpMapValIterateAnd creates an And iterator predicate on map values.
NewPredExpMapValIterateOr creates an Or iterator predicate on map values.
NewPredExpNot creates a NOT predicate.
NewPredExpOr creates an OR predicate.
NewPredExpRecDeviceSize creates record size on disk predicate.
NewPredExpRecDigestModulo creates a digest modulo record metadata value predicate expression.
NewPredExpRecLastUpdate creates record last update predicate.
NewPredExpRecVoidTime creates record expiration time predicate expressed in nanoseconds since 1970-01-01 epoch as 64 bit integer.
NewPredExpStringBin creates a Bin predicate expression which its type is String.
NewPredExpStringEqual creates Equal predicate for string values.
NewPredExpStringRegex creates a Regex predicate.
NewPredExpStringUnequal creates Not Equal predicate for string values.
NewPredExpStringValue embeds a string value in a predicate expression.
NewPredExpStringVar creates string variable used in list/map iterations.
NewPredExpUnknownBin creates a Bin predicate expression which its type is not known.
NewQueryPolicy generates a new QueryPolicy instance with default values.
NewRangeFilter creates a range filter for query.
NewRegisterTask initializes a RegisterTask with fields needed to query server nodes.
NewRemoveTask initializes a RemoveTask with fields needed to query server nodes.
NewScanPolicy creates a new ScanPolicy instance with default values.
NewStatement initializes a new Statement instance.
NewStringValue generates a StringValue instance.
NewValue generates a new Value object based on the type.
NewValueArray generates a ValueArray instance.
NewWildCardValue generates a WildCardValue instance.
NewWritePolicy initializes a new WritePolicy instance with default parameters.
PackBool packs a bool value.
PackBytes backs a byte array.
PackFloat32 packs float32 value.
PackFloat64 packs float64 value.
PackInt64 packs an int64.
PackJson packs json data.
PackList packs any slice that implement the ListIter interface.
PackMap packs any map that implements the MapIter interface.
PackNil packs a nil value.
PackString packs a string.
PackUInt64 packs a uint64.
PartitionForRead returns a partition for read purposes.
PartitionForWrite returns a partition for write purposes.
PrependOp creates string prepend database operation.
PutOp creates set database operation.
RequestInfo gets info values by name from the specified connection.
SetAerospikeTag sets the bin tag to the specified tag.
SetLuaPath sets the Lua interpreter path to files This path is used to load UDFs for QueryAggregate command.
TouchOp creates touch record database operation.

# Constants

AuthModeExternal uses external authentication (like LDAP).
AuthModeInternal uses internal authentication only.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
BitOverflowActionFail specifies to fail operation with error.
BitOverflowActionSaturate specifies that in add/subtract overflows/underflows, set to max/min value.
BitOverflowActionWrap specifies that in add/subtract overflows/underflows, wrap the value.
BitResizeFlagsDefault specifies the defalt flag.
BitResizeFlagsFromFront Adds/removes bytes from the beginning instead of the end.
BitResizeFlagsGrowOnly will only allow the byte[] size to increase.
BitResizeFlagsShrinkOnly will only allow the byte[] size to decrease.
BitWriteFlagsCreateOnly specifies that: If the bin already exists, the operation will be denied.
BitWriteFlagsDefault allows create or update.
BitWriteFlagsNoFail specifies not to raise error if operation is denied.
BitWriteFlagsPartial allows other valid operations to be committed if this operations is denied due to flag constraints.
BitWriteFlagsUpdateOnly specifies that: If the bin already exists, the bin will be overwritten.
COMMIT_ALL indicates the server should wait until successfully committing master and all replicas.
COMMIT_MASTER indicates the server should wait until successfully committing master only.
CREATE_ONLY means: Create only.
DataAdmin allows to manage indicies and user defined functions.
DEFAULT determines that the server defines the priority.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
EXPECT_GEN_EQUAL means: Update/Delete record if expected generation is equal to server generation.
EXPECT_GEN_GT means: Update/Delete record if expected generation greater than the server generation.
ExpRegexFlagEXTENDED uses POSIX Extended Regular Expression syntax when interpreting regex.
ExpRegexFlagICASE does not differentiate cases.
ExpRegexFlagNEWLINE does not Match-any-character operators don't match a newline.
ExpRegexFlagNONE uses regex defaults.
ExpRegexFlagNOSUB does not report position of matches.
FieldType constants used in the Aerospike Wire Protocol.
GEO2DSPHERE specifies 2-dimensional spherical geospatial index.
HIGH determines that the server should run the operation at the highest priority.
HLLWriteFlagsAllowFold allows the resulting set to be the minimum of provided index bits.
HLLWriteFlagsCreateOnly behaves like the following: If the bin already exists, the operation will be denied.
HLLWriteFlagsDefault is Default.
HLLWriteFlagsNoFail does not raise error if operation is denied.
HLLWriteFlagsUpdateOnly behaves like the following: If the bin already exists, the bin will be overwritten.
ICT_DEFAULT is the Normal scalar index.
ICT_LIST is Index list elements.
ICT_MAPKEYS is Index map keys.
ICT_MAPVALUES is Index map values.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
ListOrderOrdered signifies that list is Ordered.
ListOrderUnordered signifies that list is not ordered.
ListReturnTypeCount will return count of items selected.
ListReturnTypeIndex will return index offset order.
ListReturnTypeInverted will invert meaning of list command and return values.
ListReturnTypeNone will not return a result.
ListReturnTypeRank will return value order.
ListReturnTypeReverseIndex will return reverse index offset order.
ListReturnTypeReverseRank will return reserve value order.
ListReturnTypeValue will return value for single key read and value list for range read.
ListSortFlagsDefault is the default sort flag for CDT lists, and sort in Ascending order.
ListSortFlagsDescending will sort the contents of the list in descending order.
ListSortFlagsDropDuplicates will drop duplicate values in the results of the CDT list operation.
ListWriteFlagsAddUnique means: Only add unique values.
ListWriteFlagsDefault is the default behavior.
ListWriteFlagsInsertBounded means: Enforce list boundaries when inserting.
ListWriteFlagsNoFail means: do not raise error if a list item fails due to write flag constraints.
ListWriteFlagsPartial means: allow other valid list items to be committed if a list item fails due to write flag constraints.
LOW determines that the server should run the operation in a background thread.
LUA embedded programming language.
MapWriteFlagsCreateOnly means: If the key already exists, the item will be denied.
MapWriteFlagsDefault is the Default.
MapWriteFlagsNoFail means: Do not raise error if a map item is denied due to write flag constraints.
MapWriteFlagsNoFail means: Allow other valid map items to be committed if a map item is denied due to write flag constraints.
MapWriteFlagsUpdateOnly means: If the key already exists, the item will be overwritten.
MASTER reads from node containing key's master partition.
MASTER_PROLES Distributes reads across nodes containing key's master and replicated partitions in round-robin fashion.
MEDIUM determines that the server should run the operation at medium priority.
FieldType constants used in the Aerospike Wire Protocol.
NONE means: Do not use record generation to restrict writes.
NUMERIC specifies an index on numeric values.
FieldType constants used in the Aerospike Wire Protocol.
PREFER_RACK Tries nodes on the same rack first.
FieldType constants used in the Aerospike Wire Protocol.
RANDOM Distribute reads across all nodes in cluster in round-robin fashion.
Read allows read transactions with the database.
ReadModeAPAll indicates that all duplicates should be consulted in the read operation.
ReadModeAPOne indicates that a single node should be involved in the read operation.
ReadModeSCAllowReplica indicates that the server may read from master or any full (non-migrating) replica.
ReadModeSCAllowUnavailable indicates that the server may read from master or any full (non-migrating) replica or from unavailable partitions.
ReadModeSCLinearize ensures ALL clients will only see an increasing sequence of record versions.
ReadModeSCSession ensures this client will only see an increasing sequence of record versions.
ReadWrite allows read and write transactions with the database.
ReadWriteUDF allows read, write and UDF transactions with the database.
FieldType constants used in the Aerospike Wire Protocol.
REPLACE means: Create or replace record.
REPLACE_ONLY means: Replace record only.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
SEQUENCE Tries node containing master partition first.
STRING specifies an index on string values.
SysAdmin allows to manage indexes, user defined functions and server configuration.
FieldType constants used in the Aerospike Wire Protocol.
user supplied transaction id, which is simply passed back.
TTLDontExpire will never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server.
TTLDontUpdate will not change the record's ttl when record is written.
TTLServerDefault will default to namespace configuration variable "default-ttl" on the server.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
FieldType constants used in the Aerospike Wire Protocol.
UPDATE means: Create or update record.
UPDATE_ONLY means: Update record only.
UserAdmin allows to manages users and their roles.
Write allows write transactions with the database.

# Variables

64 KiB.
ExpTypeBLOB is BLOB Expression Type.
ExpTypeBOOL is BOOLEAN Expression Type.
ExpTypeFLOAT is FLOAT Expression Type.
ExpTypeGEO is GEO String Expression Type.
ExpTypeHLL is HLL Expression Type.
ExpTypeINT is INTEGER Expression Type.
ExpTypeLIST is LIST Expression Type.
ExpTypeMAP is MAP Expression Type.
ExpTypeNIL is NIL Expression Type.
ExpTypeSTRING is STRING Expression Type.
MapOrder defines map storage order.
MapReturnType defines the map return type.
MapWriteMode should only be used for server versions < 4.3.
120 MB.

# Structs

AdminPolicy contains attributes used for user administration commands.
BasePolicy encapsulates parameters for transaction policy attributes used in all database operation calls.
BatchError is a type to encapsulate the node that the error occurred in.
BatchPolicy encapsulates parameters for policy attributes used in write operations.
BatchRead specifies the Key and bin names used in batch read commands where variable bins are needed for each key.
Bin encapsulates a field name/value pair.
BitPolicy determines the Bit operation policy.
CDTContext defines Nested CDT context.
Client encapsulates an Aerospike cluster.
ClientPolicy encapsulates parameters for client policy command.
Cluster encapsulates the aerospike cluster nodes and manages them.
Connection represents a connection with a timeout.
DropIndexTask is used to poll for long running create index completion.
ExecuteTask is used to poll for long running server execute job completion.
Filter specifies a query filter definition.
FilterExpression which can be applied to most commands, to control which records are affected by the command.
HLLPolicy determines the HyperLogLog operation policy.
Host name/port of database server.
IndexTask is used to poll for long running create index completion.
InfinityValue is an empty value.
InfoPolicy contains attributes used for info commands.
Key is the unique record identifier.
ListerValue encapsulates any arbitrary array.
ListPolicy directives when creating a list and writing list items.
MapPair is used when the client returns sorted maps from the server Since the default map in Go is a hash map, we will use a slice to return the results in server order.
MapperValue encapsulates an arbitrary map which implements a MapIter interface.
MapPolicy directives when creating a map and writing map items.
MultiPolicy contains parameters for policy attributes used in query and scan operations.
Node represents an Aerospike Database Server Node.
NodeError is a type to encapsulate the node that the error occurred in.
NullValue is an empty value.
Operation contains operation definition.
Partition encapsulates partition information.
PartitionFilter is used in scan/queries.
Partitions represents a list of partitions.
Privilege determines user access granularity.
QueryPolicy encapsulates parameters for policy attributes used in query operations.
Record is the container struct for database records.
Recordset encapsulates the result of Scan and Query commands.
RegisterTask is used to poll for UDF registration completion.
RemoveTask is used to poll for UDF registration completion.
Result is the value returned by Recordset's Results() function.
Role allows granular access to database entities for users.
ScanPolicy encapsulates parameters used in scan operations.
Statement encapsulates query statement parameters.
UDF carries information about UDFs on the server.
UserRoles contains information about a user.
WildCardValue is an empty value.
WritePolicy encapsulates parameters for policy attributes used in write operations.

# Interfaces

AerospikeBlob interface allows the user to write a conversion function from their value to []bytes.
BufferEx is a specialized buffer interface for aerospike client.
ExpressionArgument is used for passing arguments to filter expressions.
ListIter allows to define general maps of your own type to be used in the Go client without the use of reflection.
MapIter allows to define general maps of your own type to be used in the Go client without the use of reflection.
Policy Interface.
PredExp represents a predicate expression.
Task interface defines methods for asynchronous tasks.
Value interface is used to efficiently serialize objects into the wire protocol.

# Type aliases

AuthMode determines authentication mode when user/password is defined.
BinMap is used to define a map of bin names to values.
BitOverflowAction specifies the action to take when bitwise add/subtract results in overflow/underflow.
BitResizeFlags specifies the bitwise operation flags for resize.
BytesValue encapsulates an array of bytes.
CommitLevel indicates the desired consistency guarantee when committing a transaction on the server.
ExpRegexFlags is used to change the Regex Mode in Expression Filters.
ExpType defines the expression's data type.
FieldType represents the type of the field in Aerospike Wire Protocol.
FloatValue encapsulates an float64 value.
GenerationPolicy determines how to handle record writes based on record generation.
GeoJSONValue encapsulates a 2D Geo point.
HLLValue encapsulates a HyperLogLog value.
IndexCollectionType is the secondary index collection type.
IndexType the type of the secondary index.
IntegerValue encapsulates an integer value.
JsonValue encapsulates a Json map.
Language specifies User defined function languages.
ListOrderType determines the order of returned values in CDT list operations.
ListReturnType determines the returned values in CDT List operations.
ListSortFlags detemines sort flags for CDT lists.
ListValue encapsulates any arbitrary array.
LongValue encapsulates an int64 value.
MapValue encapsulates an arbitrary map.
Priority of operations on database server.
ReadModeAP is the read policy in AP (availability) mode namespaces.
ReadModeSC is the read policy in SC (strong consistency) mode namespaces.
RecordExistsAction determines how to handle writes when the record already exists.
ReplicaPolicy defines type of node partition targeted by read commands.
StringValue encapsulates a string value.
ValueArray encapsulates an array of Value.