Documentation ¶
Overview ¶
Package aerospike provides a client to connect and interact with an Aerospike cluster. This is the official Go implementation of the Aerospike Client.
Index ¶
- Constants
- Variables
- func PackBool(cmd BufferEx, val bool) (int, error)
- func PackBytes(cmd BufferEx, b []byte) (int, error)
- func PackFloat32(cmd BufferEx, val float32) (int, error)
- func PackFloat64(cmd BufferEx, val float64) (int, error)
- func PackInt64(cmd BufferEx, val int64) (int, error)
- func PackJson(cmd BufferEx, theMap map[string]interface{}) (int, error)
- func PackList(cmd BufferEx, list ListIter) (int, error)
- func PackMap(cmd BufferEx, theMap MapIter) (int, error)
- func PackNil(cmd BufferEx) (int, error)
- func PackString(cmd BufferEx, val string) (int, error)
- func PackUInt64(cmd BufferEx, val uint64) (int, error)
- func RequestInfo(conn *Connection, names ...string) (map[string]string, error)
- func SetAerospikeTag(tag string)
- func SetLuaPath(lpath string)
- type AdminPolicy
- type AerospikeBlob
- type AuthMode
- type BasePolicy
- type BatchError
- type BatchPolicy
- type BatchRead
- type Bin
- type BinMap
- type BitOverflowAction
- type BitPolicy
- type BitResizeFlags
- type BufferEx
- type BytesValue
- type CDTContext
- func CtxListIndex(index int) *CDTContext
- func CtxListIndexCreate(index int, order ListOrderType, pad bool) *CDTContext
- func CtxListRank(rank int) *CDTContext
- func CtxListValue(key Value) *CDTContext
- func CtxMapIndex(index int) *CDTContext
- func CtxMapKey(key Value) *CDTContext
- func CtxMapKeyCreate(key Value, order mapOrderType) *CDTContext
- func CtxMapRank(rank int) *CDTContext
- func CtxMapValue(key Value) *CDTContext
- type Client
- func (clnt *Client) Add(policy *WritePolicy, key *Key, binMap BinMap) error
- func (clnt *Client) AddBins(policy *WritePolicy, key *Key, bins ...*Bin) error
- func (clnt *Client) Append(policy *WritePolicy, key *Key, binMap BinMap) error
- func (clnt *Client) AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) error
- func (clnt *Client) BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, error)
- func (clnt *Client) BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, error)
- func (clnt *Client) BatchGetComplex(policy *BatchPolicy, records []*BatchRead) error
- func (clnt *Client) BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, error)
- func (clnt *Client) BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err error)
- func (clnt *Client) ChangePassword(policy *AdminPolicy, user string, password string) error
- func (clnt *Client) Close()
- func (clnt *Client) Cluster() *Cluster
- func (clnt *Client) CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, ...) (*IndexTask, error)
- func (clnt *Client) CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, ...) (*IndexTask, error)
- func (clnt *Client) CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, ...) error
- func (clnt *Client) CreateUser(policy *AdminPolicy, user string, password string, roles []string) error
- func (clnt *Client) Delete(policy *WritePolicy, key *Key) (bool, error)
- func (clnt *Client) DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) error
- func (clnt *Client) DropRole(policy *AdminPolicy, roleName string) error
- func (clnt *Client) DropUser(policy *AdminPolicy, user string) error
- func (clnt *Client) Execute(policy *WritePolicy, key *Key, packageName string, functionName string, ...) (interface{}, error)
- func (clnt *Client) ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, ...) (*ExecuteTask, error)
- func (clnt *Client) ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, ...) (*ExecuteTask, error)
- func (clnt *Client) Exists(policy *BasePolicy, key *Key) (bool, error)
- func (clnt *Client) Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, error)
- func (clnt *Client) GetHeader(policy *BasePolicy, key *Key) (*Record, error)
- func (clnt *Client) GetNodeNames() []string
- func (clnt *Client) GetNodes() []*Node
- func (clnt *Client) GetObject(policy *BasePolicy, key *Key, obj interface{}) error
- func (clnt *Client) GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) error
- func (clnt *Client) GrantRoles(policy *AdminPolicy, user string, roles []string) error
- func (clnt *Client) IsConnected() bool
- func (clnt *Client) ListUDF(policy *BasePolicy) ([]*UDF, error)
- func (clnt *Client) Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, error)
- func (clnt *Client) Prepend(policy *WritePolicy, key *Key, binMap BinMap) error
- func (clnt *Client) PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) error
- func (clnt *Client) Put(policy *WritePolicy, key *Key, binMap BinMap) error
- func (clnt *Client) PutBins(policy *WritePolicy, key *Key, bins ...*Bin) error
- func (clnt *Client) PutObject(policy *WritePolicy, key *Key, obj interface{}) (err error)
- func (clnt *Client) Query(policy *QueryPolicy, statement *Statement) (*Recordset, error)
- func (clnt *Client) QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, ...) (*Recordset, error)
- func (clnt *Client) QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ...) (*ExecuteTask, error)
- func (clnt *Client) QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, error)
- func (clnt *Client) QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, error)
- func (clnt *Client) QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, error)
- func (clnt *Client) QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, ...) (*Recordset, error)
- func (clnt *Client) QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, error)
- func (clnt *Client) QueryRole(policy *AdminPolicy, role string) (*Role, error)
- func (clnt *Client) QueryRoles(policy *AdminPolicy) ([]*Role, error)
- func (clnt *Client) QueryUser(policy *AdminPolicy, user string) (*UserRoles, error)
- func (clnt *Client) QueryUsers(policy *AdminPolicy) ([]*UserRoles, error)
- func (clnt *Client) RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, error)
- func (clnt *Client) RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, error)
- func (clnt *Client) RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, error)
- func (clnt *Client) RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) error
- func (clnt *Client) RevokeRoles(policy *AdminPolicy, user string, roles []string) error
- func (clnt *Client) ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, error)
- func (clnt *Client) ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, ...) (*Recordset, error)
- func (clnt *Client) ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, ...) (*Recordset, error)
- func (clnt *Client) ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, ...) (*Recordset, error)
- func (clnt *Client) ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, ...) (*Recordset, error)
- func (clnt *Client) ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, ...) (*Recordset, error)
- func (clnt *Client) SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) error
- func (clnt *Client) SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, ...) error
- func (clnt *Client) Stats() (map[string]interface{}, error)
- func (clnt *Client) String() string
- func (clnt *Client) Touch(policy *WritePolicy, key *Key) error
- func (clnt *Client) Truncate(policy *WritePolicy, namespace, set string, beforeLastUpdate *time.Time) error
- func (clnt *Client) WarmUp(count int) (int, error)
- type ClientPolicy
- type Cluster
- func (clstr *Cluster) AddSeeds(hosts []*Host)
- func (clstr *Cluster) ClientPolicy() (res ClientPolicy)
- func (clstr *Cluster) Close()
- func (clstr *Cluster) GetAliases() map[Host]*Node
- func (clstr *Cluster) GetNodeByName(nodeName string) (*Node, error)
- func (clstr *Cluster) GetNodes() []*Node
- func (clstr *Cluster) GetRandomNode() (*Node, error)
- func (clstr *Cluster) GetSeeds() []Host
- func (clstr *Cluster) IsConnected() bool
- func (clstr *Cluster) MigrationInProgress(timeout time.Duration) (res bool, err error)
- func (clstr *Cluster) Password() (res []byte)
- func (clstr *Cluster) String() string
- func (clstr *Cluster) WaitUntillMigrationIsFinished(timeout time.Duration) error
- func (clstr *Cluster) WarmUp(count int) (int, error)
- type CommitLevel
- type Connection
- func (ctn *Connection) Authenticate(user string, password string) error
- func (ctn *Connection) Close()
- func (ctn *Connection) IsConnected() bool
- func (ctn *Connection) Login(policy *ClientPolicy) error
- func (ctn *Connection) Read(buf []byte, length int) (total int, err error)
- func (ctn *Connection) SetTimeout(deadline time.Time, socketTimeout time.Duration) error
- func (ctn *Connection) Write(buf []byte) (total int, err error)
- type DropIndexTask
- type ExecuteTask
- type ExpRegexFlags
- type ExpType
- type ExpressionArgument
- type FieldType
- type Filter
- func NewContainsFilter(binName string, indexCollectionType IndexCollectionType, value interface{}) *Filter
- func NewContainsRangeFilter(binName string, indexCollectionType IndexCollectionType, begin, end int64) *Filter
- func NewEqualFilter(binName string, value interface{}) *Filter
- func NewGeoRegionsContainingPointFilter(binName, point string) *Filter
- func NewGeoRegionsContainingPointForCollectionFilter(binName string, collectionType IndexCollectionType, point string) *Filter
- func NewGeoWithinRadiusFilter(binName string, lng, lat, radius float64) *Filter
- func NewGeoWithinRadiusForCollectionFilter(binName string, collectionType IndexCollectionType, lng, lat, radius float64) *Filter
- func NewGeoWithinRegionFilter(binName, region string) *Filter
- func NewGeoWithinRegionForCollectionFilter(binName string, collectionType IndexCollectionType, region string) *Filter
- func NewRangeFilter(binName string, begin int64, end int64) *Filter
- type FilterExpression
- func ExpAnd(exps ...*FilterExpression) *FilterExpression
- func ExpBinExists(name string) *FilterExpression
- func ExpBinType(name string) *FilterExpression
- func ExpBitAdd(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitAnd(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitCount(bitOffset *FilterExpression, bitSize *FilterExpression, bin *FilterExpression) *FilterExpression
- func ExpBitGet(bitOffset *FilterExpression, bitSize *FilterExpression, bin *FilterExpression) *FilterExpression
- func ExpBitGetInt(bitOffset *FilterExpression, bitSize *FilterExpression, signed bool, ...) *FilterExpression
- func ExpBitInsert(policy *BitPolicy, byteOffset *FilterExpression, value *FilterExpression, ...) *FilterExpression
- func ExpBitLScan(bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitLShift(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitNot(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitOr(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitRScan(bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitRShift(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitRemove(policy *BitPolicy, byteOffset *FilterExpression, byteSize *FilterExpression, ...) *FilterExpression
- func ExpBitResize(policy *BitPolicy, byteSize *FilterExpression, resizeFlags BitResizeFlags, ...) *FilterExpression
- func ExpBitSet(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitSetInt(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitSubtract(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBitXor(policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, ...) *FilterExpression
- func ExpBlobBin(name string) *FilterExpression
- func ExpBlobVal(val []byte) *FilterExpression
- func ExpBoolVal(val bool) *FilterExpression
- func ExpDeviceSize() *FilterExpression
- func ExpDigestModulo(modulo int64) *FilterExpression
- func ExpEq(left *FilterExpression, right *FilterExpression) *FilterExpression
- func ExpFloatBin(name string) *FilterExpression
- func ExpFloatVal(val float64) *FilterExpression
- func ExpGeoBin(name string) *FilterExpression
- func ExpGeoCompare(left *FilterExpression, right *FilterExpression) *FilterExpression
- func ExpGeoVal(val string) *FilterExpression
- func ExpGreater(left *FilterExpression, right *FilterExpression) *FilterExpression
- func ExpGreaterEq(left *FilterExpression, right *FilterExpression) *FilterExpression
- func ExpHLLAdd(policy *HLLPolicy, list *FilterExpression, bin *FilterExpression) *FilterExpression
- func ExpHLLAddWithIndex(policy *HLLPolicy, list *FilterExpression, indexBitCount *FilterExpression, ...) *FilterExpression
- func ExpHLLAddWithIndexAndMinHash(policy *HLLPolicy, list *FilterExpression, indexBitCount *FilterExpression, ...) *FilterExpression
- func ExpHLLBin(name string) *FilterExpression
- func ExpHLLDescribe(bin *FilterExpression) *FilterExpression
- func ExpHLLGetCount(bin *FilterExpression) *FilterExpression
- func ExpHLLGetIntersectCount(list *FilterExpression, bin *FilterExpression) *FilterExpression
- func ExpHLLGetSimilarity(list *FilterExpression, bin *FilterExpression) *FilterExpression
- func ExpHLLGetUnion(list *FilterExpression, bin *FilterExpression) *FilterExpression
- func ExpHLLGetUnionCount(list *FilterExpression, bin *FilterExpression) *FilterExpression
- func ExpHLLMayContain(list *FilterExpression, bin *FilterExpression) *FilterExpression
- func ExpIntBin(name string) *FilterExpression
- func ExpIntVal(val int64) *FilterExpression
- func ExpIsTombstone() *FilterExpression
- func ExpKey(expType ExpType) *FilterExpression
- func ExpKeyExists() *FilterExpression
- func ExpLastUpdate() *FilterExpression
- func ExpLess(left *FilterExpression, right *FilterExpression) *FilterExpression
- func ExpLessEq(left *FilterExpression, right *FilterExpression) *FilterExpression
- func ExpListAppend(policy *ListPolicy, value *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpListAppendItems(policy *ListPolicy, list *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpListBin(name string) *FilterExpression
- func ExpListClear(bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpListGetByIndex(returnType ListReturnType, value_type ExpType, index *FilterExpression, ...) *FilterExpression
- func ExpListGetByIndexRange(returnType ListReturnType, index *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpListGetByIndexRangeCount(returnType ListReturnType, index *FilterExpression, count *FilterExpression, ...) *FilterExpression
- func ExpListGetByRank(returnType ListReturnType, value_type ExpType, rank *FilterExpression, ...) *FilterExpression
- func ExpListGetByRankRange(returnType ListReturnType, rank *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpListGetByRankRangeCount(returnType ListReturnType, rank *FilterExpression, count *FilterExpression, ...) *FilterExpression
- func ExpListGetByValue(returnType ListReturnType, value *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpListGetByValueList(returnType ListReturnType, values *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpListGetByValueRange(returnType ListReturnType, valueBegin *FilterExpression, ...) *FilterExpression
- func ExpListGetByValueRelativeRankRange(returnType ListReturnType, value *FilterExpression, rank *FilterExpression, ...) *FilterExpression
- func ExpListGetByValueRelativeRankRangeCount(returnType ListReturnType, value *FilterExpression, rank *FilterExpression, ...) *FilterExpression
- func ExpListIncrement(policy *ListPolicy, index *FilterExpression, value *FilterExpression, ...) *FilterExpression
- func ExpListInsert(policy *ListPolicy, index *FilterExpression, value *FilterExpression, ...) *FilterExpression
- func ExpListInsertItems(policy *ListPolicy, index *FilterExpression, list *FilterExpression, ...) *FilterExpression
- func ExpListRemoveByIndex(index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpListRemoveByIndexRange(index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpListRemoveByIndexRangeCount(index *FilterExpression, count *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpListRemoveByRank(rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpListRemoveByRankRange(rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpListRemoveByRankRangeCount(rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpListRemoveByValue(value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpListRemoveByValueList(values *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpListRemoveByValueRange(valueBegin *FilterExpression, valueEnd *FilterExpression, ...) *FilterExpression
- func ExpListRemoveByValueRelativeRankRange(value *FilterExpression, rank *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpListRemoveByValueRelativeRankRangeCount(value *FilterExpression, rank *FilterExpression, count *FilterExpression, ...) *FilterExpression
- func ExpListSet(policy *ListPolicy, index *FilterExpression, value *FilterExpression, ...) *FilterExpression
- func ExpListSize(bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpListSort(sortFlags ListSortFlags, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpListVal(val ...Value) *FilterExpression
- func ExpListValueVal(val ...interface{}) *FilterExpression
- func ExpMapBin(name string) *FilterExpression
- func ExpMapClear(bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapGetByIndex(returnType mapReturnType, valueType ExpType, index *FilterExpression, ...) *FilterExpression
- func ExpMapGetByIndexRange(returnType mapReturnType, index *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapGetByIndexRangeCount(returnType mapReturnType, index *FilterExpression, count *FilterExpression, ...) *FilterExpression
- func ExpMapGetByKey(returnType mapReturnType, valueType ExpType, key *FilterExpression, ...) *FilterExpression
- func ExpMapGetByKeyList(returnType mapReturnType, keys *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapGetByKeyRange(returnType mapReturnType, keyBegin *FilterExpression, keyEnd *FilterExpression, ...) *FilterExpression
- func ExpMapGetByKeyRelativeIndexRange(returnType mapReturnType, key *FilterExpression, index *FilterExpression, ...) *FilterExpression
- func ExpMapGetByKeyRelativeIndexRangeCount(returnType mapReturnType, key *FilterExpression, index *FilterExpression, ...) *FilterExpression
- func ExpMapGetByRank(returnType mapReturnType, valueType ExpType, rank *FilterExpression, ...) *FilterExpression
- func ExpMapGetByRankRange(returnType mapReturnType, rank *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapGetByRankRangeCount(returnType mapReturnType, rank *FilterExpression, count *FilterExpression, ...) *FilterExpression
- func ExpMapGetByValue(returnType mapReturnType, value *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapGetByValueList(returnType mapReturnType, values *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapGetByValueRange(returnType mapReturnType, valueBegin *FilterExpression, ...) *FilterExpression
- func ExpMapGetByValueRelativeRankRange(returnType mapReturnType, value *FilterExpression, rank *FilterExpression, ...) *FilterExpression
- func ExpMapGetByValueRelativeRankRangeCount(returnType mapReturnType, value *FilterExpression, rank *FilterExpression, ...) *FilterExpression
- func ExpMapIncrement(policy *MapPolicy, key *FilterExpression, incr *FilterExpression, ...) *FilterExpression
- func ExpMapPut(policy *MapPolicy, key *FilterExpression, value *FilterExpression, ...) *FilterExpression
- func ExpMapPutItems(policy *MapPolicy, amap *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapRemoveByIndex(index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapRemoveByIndexRange(index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapRemoveByIndexRangeCount(index *FilterExpression, count *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapRemoveByKey(key *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapRemoveByKeyList(keys *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapRemoveByKeyRange(keyBegin *FilterExpression, keyEnd *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapRemoveByKeyRelativeIndexRange(key *FilterExpression, index *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapRemoveByKeyRelativeIndexRangeCount(key *FilterExpression, index *FilterExpression, count *FilterExpression, ...) *FilterExpression
- func ExpMapRemoveByRank(rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapRemoveByRankRange(rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapRemoveByRankRangeCount(rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapRemoveByValue(value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapRemoveByValueList(values *FilterExpression, bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapRemoveByValueRange(valueBegin *FilterExpression, valueEnd *FilterExpression, ...) *FilterExpression
- func ExpMapRemoveByValueRelativeRankRange(value *FilterExpression, rank *FilterExpression, bin *FilterExpression, ...) *FilterExpression
- func ExpMapRemoveByValueRelativeRankRangeCount(value *FilterExpression, rank *FilterExpression, count *FilterExpression, ...) *FilterExpression
- func ExpMapSize(bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
- func ExpMapVal(val MapValue) *FilterExpression
- func ExpMemorySize() *FilterExpression
- func ExpNilValue() *FilterExpression
- func ExpNot(exp *FilterExpression) *FilterExpression
- func ExpNotEq(left *FilterExpression, right *FilterExpression) *FilterExpression
- func ExpOr(exps ...*FilterExpression) *FilterExpression
- func ExpRegexCompare(regex string, flags ExpRegexFlags, bin *FilterExpression) *FilterExpression
- func ExpSetName() *FilterExpression
- func ExpSinceUpdate() *FilterExpression
- func ExpStringBin(name string) *FilterExpression
- func ExpStringVal(val string) *FilterExpression
- func ExpTTL() *FilterExpression
- func ExpValueArrayVal(val ValueArray) *FilterExpression
- func ExpVoidTime() *FilterExpression
- type FloatValue
- type GenerationPolicy
- type GeoJSONValue
- type HLLPolicy
- type HLLValue
- type Host
- type IndexCollectionType
- type IndexTask
- type IndexType
- type InfinityValue
- type InfoPolicy
- type IntegerValue
- type JsonValue
- type Key
- func (ky *Key) Digest() []byte
- func (ky *Key) Equals(other *Key) bool
- func (ky *Key) Namespace() string
- func (ky *Key) PartitionId() int
- func (ky *Key) SetDigest(digest []byte) error
- func (ky *Key) SetName() string
- func (ky *Key) SetValue(val Value) error
- func (ky *Key) String() string
- func (ky *Key) Value() Value
- type Language
- type ListIter
- type ListOrderType
- type ListPolicy
- type ListReturnType
- type ListSortFlags
- type ListValue
- type ListerValue
- type LongValue
- type MapIter
- type MapPair
- type MapPolicy
- type MapValue
- type MapperValue
- type MultiPolicy
- type Node
- func (nd *Node) Close()
- func (nd *Node) Equals(other *Node) bool
- func (nd *Node) GetAliases() []*Host
- func (nd *Node) GetConnection(timeout time.Duration) (conn *Connection, err error)
- func (nd *Node) GetHost() *Host
- func (nd *Node) GetName() string
- func (nd *Node) InvalidateConnection(conn *Connection)
- func (nd *Node) IsActive() bool
- func (nd *Node) MigrationInProgress() (bool, error)
- func (nd *Node) PutConnection(conn *Connection)
- func (nd *Node) Rack(namespace string) (int, error)
- func (nd *Node) Refresh(peers *peers) error
- func (nd *Node) RequestInfo(policy *InfoPolicy, name ...string) (map[string]string, error)
- func (nd *Node) RequestStats(policy *InfoPolicy) (map[string]string, error)
- func (nd *Node) String() string
- func (nd *Node) WaitUntillMigrationIsFinished(timeout time.Duration) error
- func (nd *Node) WarmUp(count int) (int, error)
- type NodeError
- type NullValue
- type Operation
- func AddOp(bin *Bin) *Operation
- func AppendOp(bin *Bin) *Operation
- func BitAddOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value int64, ...) *Operation
- func BitAndOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ...) *Operation
- func BitCountOp(binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation
- func BitGetIntOp(binName string, bitOffset int, bitSize int, signed bool, ctx ...*CDTContext) *Operation
- func BitGetOp(binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation
- func BitInsertOp(policy *BitPolicy, binName string, byteOffset int, value []byte, ...) *Operation
- func BitLScanOp(binName string, bitOffset int, bitSize int, value bool, ctx ...*CDTContext) *Operation
- func BitLShiftOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, shift int, ...) *Operation
- func BitNotOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, ...) *Operation
- func BitOrOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ...) *Operation
- func BitRScanOp(binName string, bitOffset int, bitSize int, value bool, ctx ...*CDTContext) *Operation
- func BitRShiftOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, shift int, ...) *Operation
- func BitRemoveOp(policy *BitPolicy, binName string, byteOffset int, byteSize int, ...) *Operation
- func BitResizeOp(policy *BitPolicy, binName string, byteSize int, resizeFlags BitResizeFlags, ...) *Operation
- func BitSetIntOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value int64, ...) *Operation
- func BitSetOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ...) *Operation
- func BitSubtractOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value int64, ...) *Operation
- func BitXorOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ...) *Operation
- func DeleteOp() *Operation
- func GetHeaderOp() *Operation
- func GetOp() *Operation
- func GetOpForBin(binName string) *Operation
- func HLLAddOp(policy *HLLPolicy, binName string, list []Value, ...) *Operation
- func HLLDescribeOp(binName string) *Operation
- func HLLFoldOp(binName string, indexBitCount int) *Operation
- func HLLGetCountOp(binName string) *Operation
- func HLLGetIntersectCountOp(binName string, list []HLLValue) *Operation
- func HLLGetSimilarityOp(binName string, list []HLLValue) *Operation
- func HLLGetUnionCountOp(binName string, list []HLLValue) *Operation
- func HLLGetUnionOp(binName string, list []HLLValue) *Operation
- func HLLInitOp(policy *HLLPolicy, binName string, indexBitCount, minHashBitCount int) *Operation
- func HLLRefreshCountOp(binName string) *Operation
- func HLLSetUnionOp(policy *HLLPolicy, binName string, list []HLLValue) *Operation
- func ListAppendOp(binName string, values ...interface{}) *Operation
- func ListAppendWithPolicyContextOp(policy *ListPolicy, binName string, ctx []*CDTContext, values ...interface{}) *Operation
- func ListAppendWithPolicyOp(policy *ListPolicy, binName string, values ...interface{}) *Operation
- func ListClearOp(binName string, ctx ...*CDTContext) *Operation
- func ListCreateOp(binName string, listOrder ListOrderType, pad bool, ctx ...*CDTContext) *Operation
- func ListGetByIndexOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation
- func ListGetByIndexRangeCountOp(binName string, index, count int, returnType ListReturnType, ...) *Operation
- func ListGetByIndexRangeOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation
- func ListGetByRankOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation
- func ListGetByRankRangeCountOp(binName string, rank, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation
- func ListGetByRankRangeOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation
- func ListGetByValueListOp(binName string, values []interface{}, returnType ListReturnType, ...) *Operation
- func ListGetByValueOp(binName string, value interface{}, returnType ListReturnType, ...) *Operation
- func ListGetByValueRangeOp(binName string, beginValue, endValue interface{}, returnType ListReturnType, ...) *Operation
- func ListGetByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType ListReturnType, ...) *Operation
- func ListGetByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType ListReturnType, ...) *Operation
- func ListGetOp(binName string, index int, ctx ...*CDTContext) *Operation
- func ListGetRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation
- func ListGetRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation
- func ListIncrementByOneOp(binName string, index int, ctx ...*CDTContext) *Operation
- func ListIncrementByOneWithPolicyOp(policy *ListPolicy, binName string, index int, ctx ...*CDTContext) *Operation
- func ListIncrementOp(binName string, index int, value interface{}, ctx ...*CDTContext) *Operation
- func ListIncrementWithPolicyOp(policy *ListPolicy, binName string, index int, value interface{}, ...) *Operation
- func ListInsertOp(binName string, index int, values ...interface{}) *Operation
- func ListInsertWithPolicyContextOp(policy *ListPolicy, binName string, index int, ctx []*CDTContext, ...) *Operation
- func ListInsertWithPolicyOp(policy *ListPolicy, binName string, index int, values ...interface{}) *Operation
- func ListPopOp(binName string, index int, ctx ...*CDTContext) *Operation
- func ListPopRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation
- func ListPopRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation
- func ListRemoveByIndexOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation
- func ListRemoveByIndexRangeCountOp(binName string, index, count int, returnType ListReturnType, ...) *Operation
- func ListRemoveByIndexRangeOp(binName string, index, returnType ListReturnType, ctx ...*CDTContext) *Operation
- func ListRemoveByRankOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation
- func ListRemoveByRankRangeCountOp(binName string, rank int, count int, returnType ListReturnType, ...) *Operation
- func ListRemoveByRankRangeOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation
- func ListRemoveByValueListOp(binName string, values []interface{}, returnType ListReturnType, ...) *Operation
- func ListRemoveByValueOp(binName string, value interface{}, returnType ListReturnType, ...) *Operation
- func ListRemoveByValueRangeOp(binName string, returnType ListReturnType, valueBegin, valueEnd interface{}, ...) *Operation
- func ListRemoveByValueRelativeRankRangeCountOp(binName string, returnType ListReturnType, value interface{}, rank, count int, ...) *Operation
- func ListRemoveByValueRelativeRankRangeOp(binName string, returnType ListReturnType, value interface{}, rank int, ...) *Operation
- func ListRemoveOp(binName string, index int, ctx ...*CDTContext) *Operation
- func ListRemoveRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation
- func ListRemoveRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation
- func ListSetOp(binName string, index int, value interface{}, ctx ...*CDTContext) *Operation
- func ListSetOrderOp(binName string, listOrder ListOrderType, ctx ...*CDTContext) *Operation
- func ListSizeOp(binName string, ctx ...*CDTContext) *Operation
- func ListSortOp(binName string, sortFlags ListSortFlags, ctx ...*CDTContext) *Operation
- func ListTrimOp(binName string, index int, count int, ctx ...*CDTContext) *Operation
- func MapClearOp(binName string, ctx ...*CDTContext) *Operation
- func MapCreateOp(binName string, order mapOrderType, ctx []*CDTContext) *Operation
- func MapDecrementOp(policy *MapPolicy, binName string, key interface{}, decr interface{}, ...) *Operation
- func MapGetByIndexOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapGetByIndexRangeCountOp(binName string, index int, count int, returnType mapReturnType, ...) *Operation
- func MapGetByIndexRangeOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapGetByKeyListOp(binName string, keys []interface{}, returnType mapReturnType, ...) *Operation
- func MapGetByKeyOp(binName string, key interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapGetByKeyRangeOp(binName string, keyBegin interface{}, keyEnd interface{}, ...) *Operation
- func MapGetByKeyRelativeIndexRangeCountOp(binName string, key interface{}, index, count int, returnType mapReturnType, ...) *Operation
- func MapGetByKeyRelativeIndexRangeOp(binName string, key interface{}, index int, returnType mapReturnType, ...) *Operation
- func MapGetByRankOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapGetByRankRangeCountOp(binName string, rank int, count int, returnType mapReturnType, ...) *Operation
- func MapGetByRankRangeOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapGetByValueListOp(binName string, values []interface{}, returnType mapReturnType, ...) *Operation
- func MapGetByValueOp(binName string, value interface{}, returnType mapReturnType, ...) *Operation
- func MapGetByValueRangeOp(binName string, valueBegin interface{}, valueEnd interface{}, ...) *Operation
- func MapGetByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType mapReturnType, ...) *Operation
- func MapGetByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType mapReturnType, ...) *Operation
- func MapIncrementOp(policy *MapPolicy, binName string, key interface{}, incr interface{}, ...) *Operation
- func MapPutItemsOp(policy *MapPolicy, binName string, amap map[interface{}]interface{}, ...) *Operation
- func MapPutOp(policy *MapPolicy, binName string, key interface{}, value interface{}, ...) *Operation
- func MapRemoveByIndexOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapRemoveByIndexRangeCountOp(binName string, index int, count int, returnType mapReturnType, ...) *Operation
- func MapRemoveByIndexRangeOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapRemoveByKeyListOp(binName string, keys []interface{}, returnType mapReturnType, ...) *Operation
- func MapRemoveByKeyOp(binName string, key interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapRemoveByKeyRangeOp(binName string, keyBegin interface{}, keyEnd interface{}, ...) *Operation
- func MapRemoveByKeyRelativeIndexRangeCountOp(binName string, key interface{}, index, count int, returnType mapReturnType, ...) *Operation
- func MapRemoveByKeyRelativeIndexRangeOp(binName string, key interface{}, index int, returnType mapReturnType, ...) *Operation
- func MapRemoveByRankOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapRemoveByRankRangeCountOp(binName string, rank int, count int, returnType mapReturnType, ...) *Operation
- func MapRemoveByRankRangeOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
- func MapRemoveByValueListOp(binName string, values []interface{}, returnType mapReturnType, ...) *Operation
- func MapRemoveByValueOp(binName string, value interface{}, returnType mapReturnType, ...) *Operation
- func MapRemoveByValueRangeOp(binName string, valueBegin interface{}, valueEnd interface{}, ...) *Operation
- func MapRemoveByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType mapReturnType, ...) *Operation
- func MapRemoveByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType mapReturnType, ...) *Operation
- func MapSetPolicyOp(policy *MapPolicy, binName string, ctx ...*CDTContext) *Operation
- func MapSizeOp(binName string, ctx ...*CDTContext) *Operation
- func PrependOp(bin *Bin) *Operation
- func PutOp(bin *Bin) *Operation
- func TouchOp() *Operation
- type OperationType
- type Partition
- func (ptn *Partition) Equals(other *Partition) bool
- func (ptn *Partition) GetNodeRead(cluster *Cluster) (*Node, error)
- func (ptn *Partition) GetNodeWrite(cluster *Cluster) (*Node, error)
- func (ptn *Partition) PrepareRetryRead(isClientTimeout bool)
- func (ptn *Partition) PrepareRetryWrite(isClientTimeout bool)
- func (ptn *Partition) String() string
- type PartitionFilter
- type Partitions
- type Policy
- type PredExp
- func NewPredExpAnd(nexpr uint16) PredExp
- func NewPredExpGeoJSONBin(name string) PredExp
- func NewPredExpGeoJSONContains() PredExp
- func NewPredExpGeoJSONValue(val string) PredExp
- func NewPredExpGeoJSONVar(name string) PredExp
- func NewPredExpGeoJSONWithin() PredExp
- func NewPredExpIntegerBin(name string) PredExp
- func NewPredExpIntegerEqual() PredExp
- func NewPredExpIntegerGreater() PredExp
- func NewPredExpIntegerGreaterEq() PredExp
- func NewPredExpIntegerLess() PredExp
- func NewPredExpIntegerLessEq() PredExp
- func NewPredExpIntegerUnequal() PredExp
- func NewPredExpIntegerValue(val int64) PredExp
- func NewPredExpIntegerVar(name string) PredExp
- func NewPredExpListBin(name string) PredExp
- func NewPredExpListIterateAnd(name string) PredExp
- func NewPredExpListIterateOr(name string) PredExp
- func NewPredExpMapBin(name string) PredExp
- func NewPredExpMapKeyIterateAnd(name string) PredExp
- func NewPredExpMapKeyIterateOr(name string) PredExp
- func NewPredExpMapValIterateAnd(name string) PredExp
- func NewPredExpMapValIterateOr(name string) PredExp
- func NewPredExpNot() PredExp
- func NewPredExpOr(nexpr uint16) PredExp
- func NewPredExpRecDeviceSize() PredExp
- func NewPredExpRecDigestModulo(mod int32) PredExp
- func NewPredExpRecLastUpdate() PredExp
- func NewPredExpRecVoidTime() PredExp
- func NewPredExpStringBin(name string) PredExp
- func NewPredExpStringEqual() PredExp
- func NewPredExpStringRegex(cflags uint32) PredExp
- func NewPredExpStringUnequal() PredExp
- func NewPredExpStringValue(val string) PredExp
- func NewPredExpStringVar(name string) PredExp
- func NewPredExpUnknownBin(name string) PredExp
- type Priority
- type Privilege
- type QueryPolicy
- type ReadModeAP
- type ReadModeSC
- type Record
- type RecordExistsAction
- type Recordset
- type RegisterTask
- type RemoveTask
- type ReplicaPolicy
- type Result
- type Role
- type ScanPolicy
- type Statement
- type StringValue
- type Task
- type UDF
- type UserRoles
- type Value
- type ValueArray
- type WildCardValue
- type WritePolicy
Examples ¶
Constants ¶
const ( // BitWriteFlagsDefault allows create or update. BitWriteFlagsDefault = 0 // BitWriteFlagsCreateOnly specifies that: // If the bin already exists, the operation will be denied. // If the bin does not exist, a new bin will be created. BitWriteFlagsCreateOnly = 1 // BitWriteFlagsUpdateOnly specifies that: // If the bin already exists, the bin will be overwritten. // If the bin does not exist, the operation will be denied. BitWriteFlagsUpdateOnly = 2 // BitWriteFlagsNoFail specifies not to raise error if operation is denied. BitWriteFlagsNoFail = 4 // BitWriteFlagsPartial allows other valid operations to be committed if this operations is // denied due to flag constraints. BitWriteFlagsPartial = 8 )
const ( // ListWriteFlagsDefault is the default behavior. It means: Allow duplicate values and insertions at any index. ListWriteFlagsDefault = 0 // ListWriteFlagsAddUnique means: Only add unique values. ListWriteFlagsAddUnique = 1 // ListWriteFlagsInsertBounded means: Enforce list boundaries when inserting. Do not allow values to be inserted // at index outside current list boundaries. ListWriteFlagsInsertBounded = 2 // ListWriteFlagsNoFail means: do not raise error if a list item fails due to write flag constraints. ListWriteFlagsNoFail = 4 // ListWriteFlagsPartial means: allow other valid list items to be committed if a list item fails due to // write flag constraints. ListWriteFlagsPartial = 8 )
const ( // MapWriteFlagsDefault is the Default. Allow create or update. MapWriteFlagsDefault = 0 // MapWriteFlagsCreateOnly means: If the key already exists, the item will be denied. // If the key does not exist, a new item will be created. MapWriteFlagsCreateOnly = 1 // MapWriteFlagsUpdateOnly means: If the key already exists, the item will be overwritten. // If the key does not exist, the item will be denied. MapWriteFlagsUpdateOnly = 2 // MapWriteFlagsNoFail means: Do not raise error if a map item is denied due to write flag constraints. MapWriteFlagsNoFail = 4 // MapWriteFlagsNoFail means: Allow other valid map items to be committed if a map item is denied due to // write flag constraints. MapWriteFlagsPartial = 8 )
*
- Map write bit flags.
- Requires server versions >= 4.3.
const ( // HLLWriteFlagsDefault is Default. Allow create or update. HLLWriteFlagsDefault = 0 // HLLWriteFlagsCreateOnly behaves like the following: // If the bin already exists, the operation will be denied. // If the bin does not exist, a new bin will be created. HLLWriteFlagsCreateOnly = 1 // HLLWriteFlagsUpdateOnly behaves like the following: // If the bin already exists, the bin will be overwritten. // If the bin does not exist, the operation will be denied. HLLWriteFlagsUpdateOnly = 2 // HLLWriteFlagsNoFail does not raise error if operation is denied. HLLWriteFlagsNoFail = 4 // HLLWriteFlagsAllowFold allows the resulting set to be the minimum of provided index bits. // Also, allow the usage of less precise HLL algorithms when minHash bits // of all participating sets do not match. HLLWriteFlagsAllowFold = 8 )
const ( // UserAdmin allows to manages users and their roles. UserAdmin privilegeCode = "user-admin" // SysAdmin allows to manage indexes, user defined functions and server configuration. SysAdmin privilegeCode = "sys-admin" // DataAdmin allows to manage indicies and user defined functions. DataAdmin privilegeCode = "data-admin" // ReadWriteUDF allows read, write and UDF transactions with the database. ReadWriteUDF privilegeCode = "read-write-udf" // ReadWrite allows read and write transactions with the database. ReadWrite privilegeCode = "read-write" // Read allows read transactions with the database. Read privilegeCode = "read" // Write allows write transactions with the database. Write privilegeCode = "write" )
Pre-defined user roles.
const ( // TTLServerDefault will default to namespace configuration variable "default-ttl" on the server. TTLServerDefault = 0 // TTLDontExpire will never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server. TTLDontExpire = math.MaxUint32 // TTLDontUpdate will not change the record's ttl when record is written. Supported by Aerospike server versions >= 3.10.1 TTLDontUpdate = math.MaxUint32 - 1 )
Variables ¶
var DefaultBufferSize = 64 * 1024 // 64 KiB
DefaultBufferSize specifies the initial size of the connection buffer when it is created. If not big enough (as big as the average record), it will be reallocated to size again which will be more expensive.
var MapOrder = struct { // Map is not ordered. This is the default. UNORDERED mapOrderType // 0 // Order map by key. KEY_ORDERED mapOrderType // 1 // Order map by key, then value. KEY_VALUE_ORDERED mapOrderType // 3 }{mapOrderType{0, 0x40}, mapOrderType{1, 0x80}, mapOrderType{3, 0xc0}}
MapOrder defines map storage order.
var MapReturnType = struct { // NONE will will not return a result. NONE mapReturnType // INDEX will return key index order. // // 0 = first key // N = Nth key // -1 = last key INDEX mapReturnType // REVERSE_INDEX will return reverse key order. // // 0 = last key // -1 = first key REVERSE_INDEX mapReturnType // RANK will return value order. // // 0 = smallest value // N = Nth smallest value // -1 = largest value RANK mapReturnType // REVERSE_RANK will return reserve value order. // // 0 = largest value // N = Nth largest value // -1 = smallest value REVERSE_RANK mapReturnType // COUNT will return count of items selected. COUNT mapReturnType // KEY will return key for single key read and key list for range read. KEY mapReturnType // VALUE will return value for single key read and value list for range read. VALUE mapReturnType // KEY_VALUE will return key/value items. The possible return types are: // // map[interface{}]interface{} : Returned for unordered maps // []MapPair : Returned for range results where range order needs to be preserved. KEY_VALUE mapReturnType // INVERTED will invert meaning of map command and return values. For example: // MapRemoveByKeyRange(binName, keyBegin, keyEnd, MapReturnType.KEY | MapReturnType.INVERTED) // With the INVERTED flag enabled, the keys outside of the specified key range will be removed and returned. INVERTED mapReturnType }{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 0x10000, }
MapReturnType defines the map return type. Type of data to return when selecting or removing items from the map.
var MapWriteMode = struct { // If the key already exists, the item will be overwritten. // If the key does not exist, a new item will be created. UPDATE *mapWriteMode // If the key already exists, the item will be overwritten. // If the key does not exist, the write will fail. UPDATE_ONLY *mapWriteMode // If the key already exists, the write will fail. // If the key does not exist, a new item will be created. CREATE_ONLY *mapWriteMode }{ &mapWriteMode{cdtMapOpTypePut, cdtMapOpTypePutItems}, &mapWriteMode{cdtMapOpTypeReplace, cdtMapOpTypeReplaceItems}, &mapWriteMode{cdtMapOpTypeAdd, cdtMapOpTypeAddItems}, }
MapWriteMode should only be used for server versions < 4.3. MapWriteFlags are recommended for server versions >= 4.3.
var ( // MaxBufferSize protects against allocating massive memory blocks // for buffers. Tweak this number if you are returning a lot of // LDT elements in your queries. MaxBufferSize = 1024 * 1024 * 120 // 120 MB )
Functions ¶
func PackFloat32 ¶
PackFloat32 packs float32 value
func PackFloat64 ¶
PackFloat64 packs float64 value
func RequestInfo ¶
func RequestInfo(conn *Connection, names ...string) (map[string]string, error)
RequestInfo gets info values by name from the specified connection. Timeout should already be set on the connection.
func SetAerospikeTag ¶
func SetAerospikeTag(tag string)
SetAerospikeTag sets the bin tag to the specified tag. This will be useful for when a user wants to use the same tag name for two different concerns. For example, one will be able to use the same tag name for both json and aerospike bin name.
func SetLuaPath ¶
func SetLuaPath(lpath string)
SetLuaPath sets the Lua interpreter path to files This path is used to load UDFs for QueryAggregate command
Types ¶
type AdminPolicy ¶
type AdminPolicy struct { // User administration command socket timeout. // Default is 2 seconds. Timeout time.Duration }
AdminPolicy contains attributes used for user administration commands.
func NewAdminPolicy ¶
func NewAdminPolicy() *AdminPolicy
NewAdminPolicy generates a new AdminPolicy with default values.
type AerospikeBlob ¶
type AerospikeBlob interface { // EncodeBlob returns a byte slice representing the encoding of the // receiver for transmission to a Decoder, usually of the same // concrete type. EncodeBlob() ([]byte, error) }
AerospikeBlob interface allows the user to write a conversion function from their value to []bytes.
type AuthMode ¶
type AuthMode int
AuthMode determines authentication mode when user/password is defined.
const ( // AuthModeInternal uses internal authentication only. Hashed password is stored on the server. // Do not send clear password. This is the default. AuthModeInternal AuthMode = iota // AuthModeExternal uses external authentication (like LDAP). Specific external authentication is // configured on server. If TLSConfig is defined, sends clear password on node login via TLS. // Will return an error if TLSConfig is not defined. AuthModeExternal )
type BasePolicy ¶
type BasePolicy struct { Policy // PredExps is the optional predicate expression filter in postfix notation. If the predicate // expression exists and evaluates to false, the transaction is ignored. // // Default: nil // NOTE: This feature is deprecated on Aerospike servers and will be removed in the future. // It has been replaced by FilterExpressions. PredExp []PredExp // FilterExpression is the optional Filter Expression. Supported on Server v5.2+ FilterExpression *FilterExpression // Priority of request relative to other transactions. // Only used for scans on server versions < 4.9. // // Priority is obsolete and will eventually be removed. // Use ScanPolicy.RecordsPerSecond instead of priority. Priority Priority //= Priority.DEFAULT; // ReadModeAP indicates read policy for AP (availability) namespaces. ReadModeAP ReadModeAP //= ONE // ReadModeSC indicates read policy for SC (strong consistency) namespaces. ReadModeSC ReadModeSC //= SESSION; // TotalTimeout specifies total transaction timeout. // // The TotalTimeout is tracked on the client and also sent to the server along // with the transaction in the wire protocol. The client will most likely // timeout first, but the server has the capability to Timeout the transaction. // // If TotalTimeout is not zero and TotalTimeout is reached before the transaction // completes, the transaction will abort with TotalTimeout error. // // If TotalTimeout is zero, there will be no time limit and the transaction will retry // on network timeouts/errors until MaxRetries is exceeded. If MaxRetries is exceeded, the // transaction also aborts with Timeout error. // // Default: 0 (no time limit and rely on MaxRetries). TotalTimeout time.Duration // SocketTimeout determines network timeout for each attempt. // // If SocketTimeout is not zero and SocketTimeout is reached before an attempt completes, // the Timeout above is checked. If Timeout is not exceeded, the transaction // is retried. If both SocketTimeout and Timeout are non-zero, SocketTimeout must be less // than or equal to Timeout, otherwise Timeout will also be used for SocketTimeout. // // Default: 30s SocketTimeout time.Duration // MaxRetries determines the maximum number of retries before aborting the current transaction. // The initial attempt is not counted as a retry. // // If MaxRetries is exceeded, the transaction will abort with an error. // // WARNING: Database writes that are not idempotent (such as AddOp) // should not be retried because the write operation may be performed // multiple times if the client timed out previous transaction attempts. // It's important to use a distinct WritePolicy for non-idempotent // writes which sets maxRetries = 0; // // Default for read: 2 (initial attempt + 2 retries = 3 attempts) // // Default for write: 0 (no retries) // // Default for partition scan or query with nil filter: 5 // (6 attempts. See ScanPolicy comments.) // // No default for legacy scan/query. No retries are allowed for these commands. MaxRetries int //= 2; // SleepBetweenRtries determines the duration to sleep between retries. Enter zero to skip sleep. // This field is ignored when maxRetries is zero. // This field is also ignored in async mode. // // The sleep only occurs on connection errors and server timeouts // which suggest a node is down and the cluster is reforming. // The sleep does not occur when the client's socketTimeout expires. // // Reads do not have to sleep when a node goes down because the cluster // does not shut out reads during cluster reformation. The default for // reads is zero. // // The default for writes is also zero because writes are not retried by default. // Writes need to wait for the cluster to reform when a node goes down. // Immediate write retries on node failure have been shown to consistently // result in errors. If maxRetries is greater than zero on a write, then // sleepBetweenRetries should be set high enough to allow the cluster to // reform (>= 500ms). SleepBetweenRetries time.Duration //= 1ms; // SleepMultiplier specifies the multiplying factor to be used for exponential backoff during retries. // Default to (1.0); Only values greater than 1 are valid. SleepMultiplier float64 //= 1.0; // SendKey determines to whether send user defined key in addition to hash digest on both reads and writes. // If the key is sent on a write, the key will be stored with the record on // the server. // The default is to not send the user defined key. SendKey bool // = false // UseCompression uses zlib compression on command buffers sent to the server and responses received // from the server when the buffer size is greater than 128 bytes. // // This option will increase cpu and memory usage (for extra compressed buffers),but // decrease the size of data sent over the network. // // Default: false UseCompression bool // = false // ReplicaPolicy determines the node to send the read commands containing the key's partition replica type. // Write commands are not affected by this setting, because all writes are directed // to the node containing the key's master partition. // Scan and query are also not affected by replica algorithms. // Default to sending read commands to the node containing the key's master partition. ReplicaPolicy ReplicaPolicy }
BasePolicy encapsulates parameters for transaction policy attributes used in all database operation calls.
func NewPolicy ¶
func NewPolicy() *BasePolicy
NewPolicy generates a new BasePolicy instance with default values.
func (*BasePolicy) GetBasePolicy ¶
func (p *BasePolicy) GetBasePolicy() *BasePolicy
GetBasePolicy returns embedded BasePolicy in all types that embed this struct.
type BatchError ¶
BatchError is a type to encapsulate the node that the error occurred in.
type BatchPolicy ¶
type BatchPolicy struct { BasePolicy // Maximum number of concurrent batch request goroutines to server nodes at any point in time. // If there are 16 node/namespace combinations requested and ConcurrentNodes is 8, // then batch requests will be made for 8 node/namespace combinations in concurrent goroutines. // When a request completes, a new request will be issued until all 16 goroutines are complete. // // Values: // 1: Issue batch requests sequentially. This mode has a performance advantage for small // to medium sized batch sizes because requests can be issued in the main transaction goroutine. // This is the default. // 0: Issue all batch requests in concurrent goroutines. This mode has a performance // advantage for extremely large batch sizes because each node can process the request // immediately. The downside is extra goroutines will need to be created (or taken from // a goroutine pool). // > 0: Issue up to ConcurrentNodes batch requests in concurrent goroutines. When a request // completes, a new request will be issued until all goroutines are complete. This mode // prevents too many concurrent goroutines being created for large cluster implementations. // The downside is extra goroutines will still need to be created (or taken from a goroutine pool). ConcurrentNodes int // = 1 // DirectGetThreshold determines the maximum number of keys per node which would work around // the batch request and would turn it into a direct get request. // Batch requests with few keys per node can have increased latency, due to the way the server // handles batch requests. Coverting those requests to direct get commands will be beneficial. // Don't use values greater than 4, it will significantly degrade the performance. // // Values: // <= 0: No threshold. Batch commands will always be used. // > 0: Batch requests with this many or fewer keys will be converted to direct get requests sequencially. DirectGetThreshold int // = 0 // Allow batch to be processed immediately in the server's receiving thread when the server // deems it to be appropriate. If false, the batch will always be processed in separate // transaction goroutines. This field is only relevant for the new batch index protocol. // // For batch exists or batch reads of smaller sized records (<= 1K per record), inline // processing will be significantly faster on "in memory" namespaces. The server disables // inline processing on disk based namespaces regardless of this policy field. // // Inline processing can introduce the possibility of unfairness because the server // can process the entire batch before moving onto the next command. AllowInline bool //= true // AllowPartialResults determines if the results for some nodes should be returned in case // some nodes encounter an error. The result for the unreceived records will be nil. // The returned records will be safe to use, since only fully received data will be parsed // and set. // // This flag is only supported for BatchGet and BatchGetHeader methods. BatchGetComplex always returns // partial results by design. AllowPartialResults bool //= false // Send set name field to server for every key in the batch for batch index protocol. // This is only necessary when authentication is enabled and security roles are defined // on a per set basis. SendSetName bool //= false }
BatchPolicy encapsulates parameters for policy attributes used in write operations. This object is passed into methods where database writes can occur.
func NewBatchPolicy ¶
func NewBatchPolicy() *BatchPolicy
NewBatchPolicy initializes a new BatchPolicy instance with default parameters.
type BatchRead ¶
type BatchRead struct { // Key specifies the key to retrieve. Key *Key // BinNames specifies the Bins to retrieve for this key. BinNames []string // ReadAllBins defines what data should be read from the record. // If true, ignore binNames and read all bins. // If false and binNames are set, read specified binNames. // If false and binNames are not set, read record header (generation, expiration) only. ReadAllBins bool //= false // Record result after batch command has completed. Will be null if record was not found. Record *Record }
BatchRead specifies the Key and bin names used in batch read commands where variable bins are needed for each key.
func NewBatchRead ¶
NewBatchRead defines a key and bins to retrieve in a batch operation.
func NewBatchReadHeader ¶
NewBatchReadHeader defines a key to retrieve the record headers only in a batch operation.
type Bin ¶
type Bin struct { // Bin name. Current limit is 14 characters. Name string // Bin value. Value Value }
Bin encapsulates a field name/value pair.
type BinMap ¶
type BinMap map[string]interface{}
BinMap is used to define a map of bin names to values.
type BitOverflowAction ¶
type BitOverflowAction int
BitOverflowAction specifies the action to take when bitwise add/subtract results in overflow/underflow.
const ( // BitOverflowActionFail specifies to fail operation with error. BitOverflowActionFail BitOverflowAction = 0 // BitOverflowActionSaturate specifies that in add/subtract overflows/underflows, set to max/min value. // Example: MAXINT + 1 = MAXINT BitOverflowActionSaturate BitOverflowAction = 2 // BitOverflowActionWrap specifies that in add/subtract overflows/underflows, wrap the value. // Example: MAXINT + 1 = -1 BitOverflowActionWrap BitOverflowAction = 4 )
type BitPolicy ¶
type BitPolicy struct {
// contains filtered or unexported fields
}
BitPolicy determines the Bit operation policy.
func DefaultBitPolicy ¶
func DefaultBitPolicy() *BitPolicy
DefaultBitPolicy will return the default BitPolicy
func NewBitPolicy ¶
NewBitPolicy will return a BitPolicy will provided flags.
type BitResizeFlags ¶
type BitResizeFlags int
BitResizeFlags specifies the bitwise operation flags for resize.
const ( // BitResizeFlagsDefault specifies the defalt flag. BitResizeFlagsDefault BitResizeFlags = 0 // BitResizeFlagsFromFront Adds/removes bytes from the beginning instead of the end. BitResizeFlagsFromFront BitResizeFlags = 1 // BitResizeFlagsGrowOnly will only allow the byte[] size to increase. BitResizeFlagsGrowOnly BitResizeFlags = 2 // BitResizeFlagsShrinkOnly will only allow the byte[] size to decrease. BitResizeFlagsShrinkOnly BitResizeFlags = 4 )
type BufferEx ¶
type BufferEx interface { WriteInt64(num int64) int WriteUint64(num uint64) int WriteInt32(num int32) int WriteUint32(num uint32) int WriteInt16(num int16) int WriteUint16(num uint16) int WriteFloat32(float float32) int WriteFloat64(float float64) int WriteBool(b bool) int WriteByte(b byte) WriteString(s string) (int, error) Write(b []byte) (int, error) }
BufferEx is a specialized buffer interface for aerospike client.
type BytesValue ¶
type BytesValue []byte
BytesValue encapsulates an array of bytes.
func NewBlobValue ¶
func NewBlobValue(object AerospikeBlob) BytesValue
NewBlobValue accepts an AerospikeBlob interface, and automatically converts it to a BytesValue. If Encode returns an err, it will panic.
func NewBytesValue ¶
func NewBytesValue(bytes []byte) BytesValue
NewBytesValue generates a ByteValue instance.
func (BytesValue) EstimateSize ¶
func (vl BytesValue) EstimateSize() (int, error)
EstimateSize returns the size of the BytesValue in wire protocol.
func (BytesValue) GetObject ¶
func (vl BytesValue) GetObject() interface{}
GetObject returns original value as an interface{}.
func (BytesValue) GetType ¶
func (vl BytesValue) GetType() int
GetType returns wire protocol value type.
func (BytesValue) String ¶
func (vl BytesValue) String() string
String implements Stringer interface.
type CDTContext ¶
type CDTContext struct {
// contains filtered or unexported fields
}
CDTContext defines Nested CDT context. Identifies the location of nested list/map to apply the operation. for the current level. An array of CTX identifies location of the list/map on multiple levels on nesting.
func CtxListIndex ¶
func CtxListIndex(index int) *CDTContext
CtxListIndex defines Lookup list by index offset. If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. Examples: 0: First item. 4: Fifth item. -1: Last item. -3: Third to last item.
func CtxListIndexCreate ¶
func CtxListIndexCreate(index int, order ListOrderType, pad bool) *CDTContext
CtxListIndexCreate list with given type at index offset, given an order and pad.
func CtxListRank ¶
func CtxListRank(rank int) *CDTContext
CtxListRank defines Lookup list by rank. 0 = smallest value N = Nth smallest value -1 = largest value
func CtxListValue ¶
func CtxListValue(key Value) *CDTContext
CtxListValue defines Lookup list by value.
func CtxMapIndex ¶
func CtxMapIndex(index int) *CDTContext
CtxMapIndex defines Lookup map by index offset. If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. Examples: 0: First item. 4: Fifth item. -1: Last item. -3: Third to last item.
func CtxMapKeyCreate ¶
func CtxMapKeyCreate(key Value, order mapOrderType) *CDTContext
CtxMapKeyCreate creates map with given type at map key.
func CtxMapRank ¶
func CtxMapRank(rank int) *CDTContext
CtxMapRank defines Lookup map by rank. 0 = smallest value N = Nth smallest value -1 = largest value
type Client ¶
type Client struct { // DefaultPolicy is used for all read commands without a specific policy. DefaultPolicy *BasePolicy // DefaultBatchPolicy is used for all batch commands without a specific policy. DefaultBatchPolicy *BatchPolicy // DefaultWritePolicy is used for all write commands without a specific policy. DefaultWritePolicy *WritePolicy // DefaultScanPolicy is used for all scan commands without a specific policy. DefaultScanPolicy *ScanPolicy // DefaultQueryPolicy is used for all query commands without a specific policy. DefaultQueryPolicy *QueryPolicy // DefaultAdminPolicy is used for all security commands without a specific policy. DefaultAdminPolicy *AdminPolicy // DefaultInfoPolicy is used for all info commands without a specific policy. DefaultInfoPolicy *InfoPolicy // contains filtered or unexported fields }
Client encapsulates an Aerospike cluster. All database operations are available against this object.
func NewClientWithPolicy ¶
func NewClientWithPolicy(policy *ClientPolicy, hostname string, port int) (*Client, error)
NewClientWithPolicy generates a new Client using the specified ClientPolicy. If the policy is nil, the default relevant policy will be used.
func NewClientWithPolicyAndHost ¶
func NewClientWithPolicyAndHost(policy *ClientPolicy, hosts ...*Host) (*Client, error)
NewClientWithPolicyAndHost generates a new Client 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 (*Client) Add ¶
func (clnt *Client) Add(policy *WritePolicy, key *Key, binMap BinMap) error
Add adds integer bin values to existing record bin values. The policy specifies the transaction timeout, record expiration and how the transaction is handled when the record already exists. This call only works for integer values. If the policy is nil, the default relevant policy will be used.
Example ¶
key, err := as.NewKey("test", "test", "addkey") if err != nil { log.Fatal(err) } if _, err = client.Delete(nil, key); err != nil { log.Fatal(err) } // Add to a non-existing record/bin, should create a record bin := as.NewBin("bin", 10) if err = client.AddBins(nil, key, bin); err != nil { log.Fatal(err) } // Add to 5 to the original 10 bin = as.NewBin("bin", 5) if err = client.AddBins(nil, key, bin); err != nil { log.Fatal(err) } // Check the result record, err := client.Get(nil, key, bin.Name) if err != nil { log.Fatal(err) } fmt.Println(record.Bins["bin"]) // Demonstrate add and get combined. bin = as.NewBin("bin", 30) if record, err = client.Operate(nil, key, as.AddOp(bin), as.GetOp()); err != nil { log.Fatal(err) } fmt.Println(record.Bins["bin"])
Output: 15 45
func (*Client) AddBins ¶
func (clnt *Client) AddBins(policy *WritePolicy, key *Key, bins ...*Bin) error
AddBins works the same as Add, but avoids BinMap allocation and iteration.
func (*Client) Append ¶
func (clnt *Client) Append(policy *WritePolicy, key *Key, binMap BinMap) error
Append appends bin value's string to existing record bin values. The policy specifies the transaction timeout, record expiration and how the transaction is handled when the record already exists. This call only works for string and []byte values. If the policy is nil, the default relevant policy will be used.
Example ¶
key, err := as.NewKey("test", "test", "appendkey") if err != nil { log.Fatal(err) } if _, err = client.Delete(nil, key); err != nil { log.Fatal(err) } // Create by appending to non-existing value bin1 := as.NewBin("myBin", "Hello") if err = client.AppendBins(nil, key, bin1); err != nil { log.Fatal(err) } // Append World bin2 := as.NewBin("myBin", " World") if err = client.AppendBins(nil, key, bin2); err != nil { log.Fatal(err) } record, err := client.Get(nil, key) if err != nil { log.Fatal(err) } fmt.Println(record.Bins["myBin"])
Output: Hello World
func (*Client) AppendBins ¶
func (clnt *Client) AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) error
AppendBins works the same as Append, but avoids BinMap allocation and iteration.
func (*Client) BatchExists ¶
func (clnt *Client) BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, error)
BatchExists determines if multiple record keys exist in one batch request. The returned boolean array is in positional order with the original key array order. The policy can be used to specify timeouts. If the policy is nil, the default relevant policy will be used.
func (*Client) BatchGet ¶
func (clnt *Client) BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, error)
BatchGet reads multiple record headers and bins for specified keys in one batch request. The returned records are in positional order with the original key array order. If a key is not found, the positional record will be nil. The policy can be used to specify timeouts. If the policy is nil, the default relevant policy will be used.
func (*Client) BatchGetComplex ¶
func (clnt *Client) BatchGetComplex(policy *BatchPolicy, records []*BatchRead) error
BatchGetComplex reads multiple records for specified batch keys in one batch call. This method allows different namespaces/bins to be requested for each key in the batch. The returned records are located in the same list. If the BatchRead key field is not found, the corresponding record field will be null. The policy can be used to specify timeouts and maximum concurrent threads. This method requires Aerospike Server version >= 3.6.0.
func (*Client) BatchGetHeader ¶
func (clnt *Client) BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, error)
BatchGetHeader reads multiple record header data for specified keys in one batch request. The returned records are in positional order with the original key array order. If a key is not found, the positional record will be nil. The policy can be used to specify timeouts. If the policy is nil, the default relevant policy will be used.
func (*Client) BatchGetObjects ¶
func (clnt *Client) BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err error)
BatchGetObjects reads multiple record headers and bins for specified keys in one batch request. The returned objects are in positional order with the original key array order. If a key is not found, the positional object will not change, and the positional found boolean will be false. The policy can be used to specify timeouts. If the policy is nil, the default relevant policy will be used.
func (*Client) ChangePassword ¶
func (clnt *Client) ChangePassword(policy *AdminPolicy, user string, password string) error
ChangePassword changes a user's password. Clear-text password will be hashed using bcrypt before sending to server.
func (*Client) Close ¶
func (clnt *Client) Close()
Close closes all client connections to database server nodes.
func (*Client) CreateComplexIndex ¶
func (clnt *Client) CreateComplexIndex( policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ) (*IndexTask, error)
CreateComplexIndex creates a secondary index, with the ability to put indexes on bin containing complex data types, e.g: Maps and Lists. This asynchronous server call will return before the command is complete. The user can optionally wait for command completion by using the returned IndexTask instance. This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) CreateIndex ¶
func (clnt *Client) CreateIndex( policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, ) (*IndexTask, error)
CreateIndex creates a secondary index. This asynchronous server call will return before the command is complete. The user can optionally wait for command completion by using the returned IndexTask instance. This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) CreateRole ¶
func (clnt *Client) CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string) error
CreateRole creates a user-defined role.
func (*Client) CreateUser ¶
func (clnt *Client) CreateUser(policy *AdminPolicy, user string, password string, roles []string) error
CreateUser creates a new user with password and roles. Clear-text password will be hashed using bcrypt before sending to server.
func (*Client) Delete ¶
func (clnt *Client) Delete(policy *WritePolicy, key *Key) (bool, error)
Delete deletes a record for specified key. The policy specifies the transaction timeout. If the policy is nil, the default relevant policy will be used.
func (*Client) DropIndex ¶
func (clnt *Client) DropIndex( policy *WritePolicy, namespace string, setName string, indexName string, ) error
DropIndex deletes a secondary index. It will block until index is dropped on all nodes. This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) DropRole ¶
func (clnt *Client) DropRole(policy *AdminPolicy, roleName string) error
DropRole removes a user-defined role.
func (*Client) DropUser ¶
func (clnt *Client) DropUser(policy *AdminPolicy, user string) error
DropUser removes a user from the cluster.
func (*Client) Execute ¶
func (clnt *Client) Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, error)
Execute executes a user defined function on server and return results. The function operates on a single record. The package name is used to locate the udf file location:
udf file = <server udf dir>/<package name>.lua
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) ExecuteUDF ¶
func (clnt *Client) ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value, ) (*ExecuteTask, error)
ExecuteUDF applies user defined function on records that match the statement filter. Records are not returned to the client. This asynchronous server call will return before command is complete. The user can optionally wait for command completion by using the returned ExecuteTask instance.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) ExecuteUDFNode ¶
func (clnt *Client) ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value, ) (*ExecuteTask, error)
ExecuteUDFNode applies user defined function on records that match the statement filter on the specified node. Records are not returned to the client. This asynchronous server call will return before command is complete. The user can optionally wait for command completion by using the returned ExecuteTask instance.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) Exists ¶
func (clnt *Client) Exists(policy *BasePolicy, key *Key) (bool, error)
Exists determine if a record key exists. The policy can be used to specify timeouts. If the policy is nil, the default relevant policy will be used.
func (*Client) Get ¶
Get reads a record header and bins for specified key. The policy can be used to specify timeouts. If the policy is nil, the default relevant policy will be used.
func (*Client) GetHeader ¶
func (clnt *Client) GetHeader(policy *BasePolicy, key *Key) (*Record, error)
GetHeader reads a record generation and expiration only for specified key. Bins are not read. The policy can be used to specify timeouts. If the policy is nil, the default relevant policy will be used.
func (*Client) GetNodeNames ¶
GetNodeNames returns a list of active server node names in the cluster.
func (*Client) GetObject ¶
func (clnt *Client) GetObject(policy *BasePolicy, key *Key, obj interface{}) error
GetObject reads a record for specified key and puts the result into the provided object. The policy can be used to specify timeouts. If the policy is nil, the default relevant policy will be used.
func (*Client) GrantPrivileges ¶
func (clnt *Client) GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) error
GrantPrivileges grant privileges to a user-defined role.
func (*Client) GrantRoles ¶
func (clnt *Client) GrantRoles(policy *AdminPolicy, user string, roles []string) error
GrantRoles adds roles to user's list of roles.
func (*Client) IsConnected ¶
IsConnected determines if the client is ready to talk to the database server cluster.
func (*Client) ListUDF ¶
func (clnt *Client) ListUDF(policy *BasePolicy) ([]*UDF, error)
ListUDF lists all packages containing user defined functions in the server. This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) Operate ¶
func (clnt *Client) Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, error)
Operate performs multiple read/write operations on a single key in one batch request. An example would be to add an integer value to an existing record and then read the result, all in one database call.
If the policy is nil, the default relevant policy will be used.
func (*Client) Prepend ¶
func (clnt *Client) Prepend(policy *WritePolicy, key *Key, binMap BinMap) error
Prepend prepends bin value's string to existing record bin values. The policy specifies the transaction timeout, record expiration and how the transaction is handled when the record already exists. This call works only for string and []byte values. If the policy is nil, the default relevant policy will be used.
func (*Client) PrependBins ¶
func (clnt *Client) PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) error
PrependBins works the same as Prepend, but avoids BinMap allocation and iteration.
func (*Client) Put ¶
func (clnt *Client) Put(policy *WritePolicy, key *Key, binMap BinMap) error
Put writes record bin(s) to the server. The policy specifies the transaction timeout, record expiration and how the transaction is handled when the record already exists. If the policy is nil, the default relevant policy will be used.
func (*Client) PutBins ¶
func (clnt *Client) PutBins(policy *WritePolicy, key *Key, bins ...*Bin) error
PutBins writes record bin(s) to the server. The policy specifies the transaction timeout, record expiration and how the transaction is handled when the record already exists. This method avoids using the BinMap allocation and iteration and is lighter on GC. If the policy is nil, the default relevant policy will be used.
func (*Client) PutObject ¶
func (clnt *Client) PutObject(policy *WritePolicy, key *Key, obj interface{}) (err error)
PutObject writes record bin(s) to the server. The policy specifies the transaction timeout, record expiration and how the transaction is handled when the record already exists. If the policy is nil, the default relevant policy will be used. A struct can be tagged to influence the way the object is put in the database:
type Person struct { TTL uint32 `asm:"ttl"` RecGen uint32 `asm:"gen"` Name string `as:"name"` Address string `as:"desc,omitempty"` Age uint8 `as:",omitempty"` Password string `as:"-"` }
Tag `as:` denotes Aerospike fields. The first value will be the alias for the field. `,omitempty` (without any spaces between the comma and the word) will act like the json package, and will not send the value of the field to the database if the value is zero value. Tag `asm:` denotes Aerospike Meta fields, and includes ttl and generation values. If a tag is marked with `-`, it will not be sent to the database at all. Note: Tag `as` can be replaced with any other user-defined tag via the function `SetAerospikeTag`.
func (*Client) Query ¶
func (clnt *Client) Query(policy *QueryPolicy, statement *Statement) (*Recordset, error)
Query executes a query and returns a Recordset. The query executor puts records on the channel from separate goroutines. The caller can concurrently pop records off the channel through the Recordset.Records channel.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) QueryAggregate ¶
func (clnt *Client) QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, error)
QueryAggregate executes a Map/Reduce query and returns the results. The query executor puts records on the channel from separate goroutines. The caller can concurrently pop records off the channel through the Recordset.Records channel.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) QueryExecute ¶
func (clnt *Client) QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation, ) (*ExecuteTask, error)
QueryExecute applies operations on records that match the statement filter. Records are not returned to the client. This asynchronous server call will return before the command is complete. The user can optionally wait for command completion by using the returned ExecuteTask instance.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) QueryNode ¶
func (clnt *Client) QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, error)
QueryNode executes a query on a specific node and returns a recordset. The caller can concurrently pop records off the channel through the record channel.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) QueryNodeObjects ¶
func (clnt *Client) QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, error)
QueryNodeObjects executes a query on a specific node and marshals the records into the given channel. The caller can concurrently pop records off the channel.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) QueryObjects ¶
func (clnt *Client) QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, error)
QueryObjects executes a query on all nodes in the cluster and marshals the records into the given channel. The query executor puts records on the channel from separate goroutines. The caller can concurrently pop objects.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) QueryPartitionObjects ¶
func (clnt *Client) QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, error)
QueryPartitionObjects executes a query for specified partitions and returns a recordset. The query executor puts records on the channel from separate goroutines. The caller can concurrently pop records off the channel through the Recordset.Records channel.
This method is only supported by Aerospike 4.9+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) QueryPartitions ¶
func (clnt *Client) QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, error)
QueryPartitions executes a query for specified partitions and returns a recordset. The query executor puts records on the channel from separate goroutines. The caller can concurrently pop records off the channel through the Recordset.Records channel.
This method is only supported by Aerospike 4.9+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) QueryRole ¶
func (clnt *Client) QueryRole(policy *AdminPolicy, role string) (*Role, error)
QueryRole retrieves privileges for a given role.
func (*Client) QueryRoles ¶
func (clnt *Client) QueryRoles(policy *AdminPolicy) ([]*Role, error)
QueryRoles retrieves all roles and their privileges.
func (*Client) QueryUser ¶
func (clnt *Client) QueryUser(policy *AdminPolicy, user string) (*UserRoles, error)
QueryUser retrieves roles for a given user.
func (*Client) QueryUsers ¶
func (clnt *Client) QueryUsers(policy *AdminPolicy) ([]*UserRoles, error)
QueryUsers retrieves all users and their roles.
func (*Client) RegisterUDF ¶
func (clnt *Client) RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, error)
RegisterUDF registers a package containing user defined functions with server. This asynchronous server call will return before command is complete. The user can optionally wait for command completion by using the returned RegisterTask instance.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) RegisterUDFFromFile ¶
func (clnt *Client) RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, error)
RegisterUDFFromFile reads a file from file system and registers the containing a package user defined functions with the server. This asynchronous server call will return before command is complete. The user can optionally wait for command completion by using the returned RegisterTask instance.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) RemoveUDF ¶
func (clnt *Client) RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, error)
RemoveUDF removes a package containing user defined functions in the server. This asynchronous server call will return before command is complete. The user can optionally wait for command completion by using the returned RemoveTask instance.
This method is only supported by Aerospike 3+ servers. If the policy is nil, the default relevant policy will be used.
func (*Client) RevokePrivileges ¶
func (clnt *Client) RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) error
RevokePrivileges revokes privileges from a user-defined role.
func (*Client) RevokeRoles ¶
func (clnt *Client) RevokeRoles(policy *AdminPolicy, user string, roles []string) error
RevokeRoles removes roles from user's list of roles.
func (*Client) ScanAll ¶
func (clnt *Client) ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, error)
ScanAll reads all records in specified namespace and set from all nodes. If the policy's concurrentNodes is specified, each server node will be read in parallel. Otherwise, server nodes are read sequentially. If the policy is nil, the default relevant policy will be used.
func (*Client) ScanAllObjects ¶
func (clnt *Client) ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, error)
ScanAllObjects reads all records in specified namespace and set from all nodes. If the policy's concurrentNodes is specified, each server node will be read in parallel. Otherwise, server nodes are read sequentially. If the policy is nil, the default relevant policy will be used.
func (*Client) ScanNode ¶
func (clnt *Client) ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, error)
ScanNode reads all records in specified namespace and set for one node only. If the policy is nil, the default relevant policy will be used.
func (*Client) ScanNodeObjects ¶
func (clnt *Client) ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, error)
ScanNodeObjects reads all records in specified namespace and set for one node only, and marshalls the results into the objects of the provided channel in Recordset. If the policy is nil, the default relevant policy will be used. The resulting records will be marshalled into the objChan. objChan will be closed after all the records are read.
func (*Client) ScanPartitionObjects ¶
func (clnt *Client) ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, error)
ScanPartitionObjects Reads records in specified namespace, set and partition filter. If the policy's concurrentNodes is specified, each server node will be read in parallel. Otherwise, server nodes are read sequentially. If partitionFilter is nil, all partitions will be scanned. If the policy is nil, the default relevant policy will be used. This method is only supported by Aerospike 4.9+ servers.
func (*Client) ScanPartitions ¶
func (clnt *Client) ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, error)
ScanPartitions Read records in specified namespace, set and partition filter. If the policy's concurrentNodes is specified, each server node will be read in parallel. Otherwise, server nodes are read sequentially. If partitionFilter is nil, all partitions will be scanned. If the policy is nil, the default relevant policy will be used. This method is only supported by Aerospike 4.9+ servers.
func (*Client) SetWhitelist ¶
func (clnt *Client) SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) error
SetWhitelist sets IP address whitelist for a role. If whitelist is nil or empty, it removes existing whitelist from role.
func (*Client) SetXDRFilter ¶
func (clnt *Client) SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *FilterExpression) error
SetXDRFilter sets XDR filter for given datacenter name and namespace. The expression filter indicates which records XDR should ship to the datacenter. Pass nil as filter to remove the currentl filter on the server.
func (*Client) Stats ¶
Stats returns internal statistics regarding the inner state of the client and the cluster.
func (*Client) Touch ¶
func (clnt *Client) Touch(policy *WritePolicy, key *Key) error
Touch updates a record's metadata. If the record exists, the record's TTL will be reset to the policy's expiration. If the record doesn't exist, it will return an error.
func (*Client) Truncate ¶
func (clnt *Client) Truncate(policy *WritePolicy, namespace, set string, beforeLastUpdate *time.Time) error
Truncate removes records in specified namespace/set efficiently. This method is many orders of magnitude faster than deleting records one at a time. Works with Aerospike Server versions >= 3.12. This asynchronous server call may return before the truncation is complete. The user can still write new records after the server call returns because new records will have last update times greater than the truncate cutoff (set at the time of truncate call). For more information, See https://www.aerospike.com/docs/reference/info#truncate
func (*Client) WarmUp ¶
WarmUp fills the connection pool with connections for all nodes. This is necessary on startup for high traffic programs. If the count is <= 0, the connection queue will be filled. If the count is more than the size of the pool, the pool will be filled. Note: One connection per node is reserved for tend operations and is not used for transactions.
type ClientPolicy ¶
type ClientPolicy struct { // AuthMode specifies authentication mode used when user/password is defined. It is set to AuthModeInternal by default. AuthMode AuthMode // User authentication to cluster. Leave empty for clusters running without restricted access. User string // Password authentication to cluster. The password will be stored by the client and sent to server // in hashed format. Leave empty for clusters running without restricted access. Password string // ClusterName sets the expected cluster ID. If not null, server nodes must return this cluster ID in order to // join the client's view of the cluster. Should only be set when connecting to servers that // support the "cluster-name" info command. (v3.10+) ClusterName string //="" // Initial host connection timeout duration. The timeout when opening a connection // to the server host for the first time. Timeout time.Duration //= 30 seconds // Connection idle timeout. Every time a connection is used, its idle // deadline will be extended by this duration. When this deadline is reached, // the connection will be closed and discarded from the connection pool. // The value is limited to 24 hours (86400s). // // It's important to set this value to a few seconds less than the server's proto-fd-idle-ms // (default 60000 milliseconds or 1 minute), so the client does not attempt to use a socket // that has already been reaped by the server. // // Connection pools are now implemented by a LIFO stack. Connections at the tail of the // stack will always be the least used. These connections are checked for IdleTimeout // on every tend (usually 1 second). // // Default: 55 seconds IdleTimeout time.Duration //= 55 seconds // LoginTimeout specifies the timeout for login operation for external authentication such as LDAP. LoginTimeout time.Duration //= 10 seconds // ConnectionQueueCache specifies the size of the Connection Queue cache PER NODE. // Note: One connection per node is reserved for tend operations and is not used for transactions. ConnectionQueueSize int //= 256 // MinConnectionsPerNode specifies the minimum number of synchronous connections allowed per server node. // Preallocate min connections on client node creation. // The client will periodically allocate new connections if count falls below min connections. // // Server proto-fd-idle-ms may also need to be increased substantially if min connections are defined. // The proto-fd-idle-ms default directs the server to close connections that are idle for 60 seconds // which can defeat the purpose of keeping connections in reserve for a future burst of activity. // // If server proto-fd-idle-ms is changed, client ClientPolicy.IdleTimeout should also be // changed to be a few seconds less than proto-fd-idle-ms. // // Default: 0 MinConnectionsPerNode int // MaxErrorRate defines the maximum number of errors allowed per node per ErrorRateWindow before // the circuit-breaker algorithm returns MAX_ERROR_RATE on database commands to that node. // If MaxErrorRate is zero, there is no error limit and // the exception will never be thrown. // // The counted error types are any error that causes the connection to close (socket errors // and client timeouts) and types.ResultCode.DEVICE_OVERLOAD. // // Default: 0 MaxErrorRate int // ErrorRateWindow defined the number of cluster tend iterations that defines the window for MaxErrorRate. // One tend iteration is defined as TendInterval plus the time to tend all nodes. // At the end of tend iteration, the error count is reset to zero and backoff state is removed // on all nodes. // // Default: 1 ErrorRateWindow int //= 1 // If set to true, will not create a new connection // to the node if there are already `ConnectionQueueSize` active connections. // Note: One connection per node is reserved for tend operations and is not used for transactions. LimitConnectionsToQueueSize bool //= true // Number of connections allowed to established at the same time. // This value does not limit the number of connections. It just // puts a threshold on the number of parallel opening connections. // By default, there are no limits. OpeningConnectionThreshold int // 0 // Throw exception if host connection fails during addHost(). FailIfNotConnected bool //= true // TendInterval determines interval for checking for cluster state changes. // Minimum possible interval is 10 Milliseconds. TendInterval time.Duration //= 1 second // A IP translation table is used in cases where different clients // use different server IP addresses. This may be necessary when // using clients from both inside and outside a local area // network. Default is no translation. // The key is the IP address returned from friend info requests to other servers. // The value is the real IP address used to connect to the server. IpMap map[string]string // UseServicesAlternate determines if the client should use "services-alternate" instead of "services" // in info request during cluster tending. //"services-alternate" returns server configured external IP addresses that client // uses to talk to nodes. "services-alternate" can be used in place of providing a client "ipMap". // This feature is recommended instead of using the client-side IpMap above. // // "services-alternate" is available with Aerospike Server versions >= 3.7.1. UseServicesAlternate bool // false // RackAware directs the client to update rack information on intervals. // When this feature is enabled, the client will prefer to use nodes which reside // on the same rack as the client for read transactions. The application should also set the RackId, and // use the ReplicaPolicy.PREFER_RACK for reads. // This feature is in particular useful if the cluster is in the cloud and the cloud provider // is charging for network bandwidth out of the zone. Keep in mind that the node on the same rack // may not be the Master, and as such the data may be stale. This setting is particularly usable // for clusters that are read heavy. RackAware bool // false // RackId defines the Rack the application is on. This will only influence reads if Rackaware is enabled on the client, // and configured on the server. RackId int // 0 // TlsConfig specifies TLS secure connection policy for TLS enabled servers. // For better performance, we suggest preferring the server-side ciphers by // setting PreferServerCipherSuites = true. TlsConfig *tls.Config //= nil // IgnoreOtherSubnetAliases helps to ignore aliases that are outside main subnet IgnoreOtherSubnetAliases bool //= false }
ClientPolicy encapsulates parameters for client policy command.
func NewClientPolicy ¶
func NewClientPolicy() *ClientPolicy
NewClientPolicy generates a new ClientPolicy with default values.
func (*ClientPolicy) RequiresAuthentication ¶
func (cp *ClientPolicy) RequiresAuthentication() bool
RequiresAuthentication returns true if a User or Password is set for ClientPolicy.
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster encapsulates the aerospike cluster nodes and manages them.
func NewCluster ¶
func NewCluster(policy *ClientPolicy, hosts []*Host) (*Cluster, error)
NewCluster generates a Cluster instance.
func (*Cluster) AddSeeds ¶
AddSeeds adds new hosts to the cluster. They will be added to the cluster on next tend call.
func (*Cluster) ClientPolicy ¶
func (clstr *Cluster) ClientPolicy() (res ClientPolicy)
ClientPolicy returns the client policy that is currently used with the cluster.
func (*Cluster) Close ¶
func (clstr *Cluster) Close()
Close closes all cached connections to the cluster nodes and stops the tend goroutine.
func (*Cluster) GetAliases ¶
GetAliases returns a list of all node aliases in the cluster
func (*Cluster) GetNodeByName ¶
GetNodeByName finds a node by name and returns an error if the node is not found.
func (*Cluster) GetRandomNode ¶
GetRandomNode returns a random node on the cluster
func (*Cluster) IsConnected ¶
IsConnected returns true if cluster has nodes and is not already closed.
func (*Cluster) MigrationInProgress ¶
MigrationInProgress determines if any node in the cluster is participating in a data migration
func (*Cluster) WaitUntillMigrationIsFinished ¶
WaitUntillMigrationIsFinished will block until all migration operations in the cluster all finished.
func (*Cluster) WarmUp ¶
WarmUp fills the connection pool with connections for all nodes. This is necessary on startup for high traffic programs. If the count is <= 0, the connection queue will be filled. If the count is more than the size of the pool, the pool will be filled. Note: One connection per node is reserved for tend operations and is not used for transactions.
type CommitLevel ¶
type CommitLevel int
CommitLevel indicates the desired consistency guarantee when committing a transaction on the server.
const ( // COMMIT_ALL indicates the server should wait until successfully committing master and all replicas. COMMIT_ALL CommitLevel = iota // COMMIT_MASTER indicates the server should wait until successfully committing master only. COMMIT_MASTER )
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents a connection with a timeout.
func NewConnection ¶
func NewConnection(policy *ClientPolicy, host *Host) (*Connection, error)
NewConnection creates a TLS connection on the network and returns the pointer. A minimum timeout of 2 seconds will always be applied. If the connection is not established in the specified timeout, an error will be returned
func (*Connection) Authenticate ¶
func (ctn *Connection) Authenticate(user string, password string) error
Authenticate will send authentication information to the server. Notice: This method does not support external authentication mechanisms like LDAP. This method is deprecated and will be removed in the future.
func (*Connection) IsConnected ¶
func (ctn *Connection) IsConnected() bool
IsConnected returns true if the connection is not closed yet.
func (*Connection) Login ¶
func (ctn *Connection) Login(policy *ClientPolicy) error
Login will send authentication information to the server. This function is provided for using the connection in conjunction with external libraries. The password will be hashed everytime, which is a slow operation.
func (*Connection) Read ¶
func (ctn *Connection) Read(buf []byte, length int) (total int, err error)
Read reads from connection buffer to the provided slice.
func (*Connection) SetTimeout ¶
SetTimeout sets connection timeout for both read and write operations.
type DropIndexTask ¶
type DropIndexTask struct {
// contains filtered or unexported fields
}
DropIndexTask is used to poll for long running create index completion.
func NewDropIndexTask ¶
func NewDropIndexTask(cluster *Cluster, namespace string, indexName string) *DropIndexTask
NewDropIndexTask initializes a task with fields needed to query server nodes.
func (*DropIndexTask) IsDone ¶
func (tski *DropIndexTask) IsDone() (bool, error)
IsDone queries all nodes for task completion status.
func (*DropIndexTask) OnComplete ¶
func (tski *DropIndexTask) OnComplete() chan error
OnComplete returns a channel that will be closed as soon as the task is finished. If an error is encountered during operation, an error will be sent on the channel.
type ExecuteTask ¶
type ExecuteTask struct {
// contains filtered or unexported fields
}
ExecuteTask is used to poll for long running server execute job completion.
func NewExecuteTask ¶
func NewExecuteTask(cluster *Cluster, statement *Statement) *ExecuteTask
NewExecuteTask initializes task with fields needed to query server nodes.
func (*ExecuteTask) IsDone ¶
func (etsk *ExecuteTask) IsDone() (bool, error)
IsDone queries all nodes for task completion status.
func (*ExecuteTask) OnComplete ¶
func (etsk *ExecuteTask) OnComplete() chan error
OnComplete returns a channel which will be closed when the task is completed. If an error is encountered while performing the task, an error will be sent on the channel.
type ExpRegexFlags ¶
type ExpRegexFlags int
ExpRegexFlags is used to change the Regex Mode in Expression Filters.
const ( // ExpRegexFlagNONE uses regex defaults. ExpRegexFlagNONE ExpRegexFlags = 0 // ExpRegexFlagEXTENDED uses POSIX Extended Regular Expression syntax when interpreting regex. ExpRegexFlagEXTENDED ExpRegexFlags = 1 // ExpRegexFlagICASE does not differentiate cases. ExpRegexFlagICASE ExpRegexFlags = 2 // ExpRegexFlagNOSUB does not report position of matches. ExpRegexFlagNOSUB ExpRegexFlags = 3 // ExpRegexFlagNEWLINE does not Match-any-character operators don't match a newline. ExpRegexFlagNEWLINE ExpRegexFlags = 8 )
type ExpType ¶
type ExpType uint
ExpType defines the expression's data type.
var ( // ExpTypeNIL is NIL Expression Type ExpTypeNIL ExpType = 0 // ExpTypeBOOL is BOOLEAN Expression Type ExpTypeBOOL ExpType = 1 // ExpTypeINT is INTEGER Expression Type ExpTypeINT ExpType = 2 // ExpTypeSTRING is STRING Expression Type ExpTypeSTRING ExpType = 3 // ExpTypeLIST is LIST Expression Type ExpTypeLIST ExpType = 4 // ExpTypeMAP is MAP Expression Type ExpTypeMAP ExpType = 5 // ExpTypeBLOB is BLOB Expression Type ExpTypeBLOB ExpType = 6 // ExpTypeFLOAT is FLOAT Expression Type ExpTypeFLOAT ExpType = 7 // ExpTypeGEO is GEO String Expression Type ExpTypeGEO ExpType = 8 // ExpTypeHLL is HLL Expression Type ExpTypeHLL ExpType = 9 )
type ExpressionArgument ¶
type ExpressionArgument interface {
// contains filtered or unexported methods
}
ExpressionArgument is used for passing arguments to filter expressions. The accptable arguments are: Value, ExpressionFilter, []*CDTContext
type FieldType ¶
type FieldType int
FieldType represents the type of the field in Aerospike Wire Protocol
const ( NAMESPACE FieldType = 0 TABLE FieldType = 1 KEY FieldType = 2 DIGEST_RIPE FieldType = 4 DIGEST_RIPE_ARRAY FieldType = 6 TRAN_ID FieldType = 7 // user supplied transaction id, which is simply passed back SCAN_OPTIONS FieldType = 8 SCAN_TIMEOUT FieldType = 9 RECORDS_PER_SECOND FieldType = 10 PID_ARRAY FieldType = 11 DIGEST_ARRAY FieldType = 12 SCAN_MAX_RECORDS FieldType = 13 INDEX_NAME FieldType = 21 INDEX_RANGE FieldType = 22 INDEX_FILTER FieldType = 23 INDEX_LIMIT FieldType = 24 INDEX_ORDER_BY FieldType = 25 INDEX_TYPE = 26 UDF_PACKAGE_NAME FieldType = 30 UDF_FUNCTION FieldType = 31 UDF_ARGLIST FieldType = 32 UDF_OP FieldType = 33 QUERY_BINLIST FieldType = 40 BATCH_INDEX FieldType = 41 BATCH_INDEX_WITH_SET FieldType = 42 FILTER_EXP FieldType = 43 )
FieldType constants used in the Aerospike Wire Protocol.
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter specifies a query filter definition.
func NewContainsFilter ¶
func NewContainsFilter(binName string, indexCollectionType IndexCollectionType, value interface{}) *Filter
NewContainsFilter creates a contains filter for query on collection index.
func NewContainsRangeFilter ¶
func NewContainsRangeFilter(binName string, indexCollectionType IndexCollectionType, begin, end int64) *Filter
NewContainsRangeFilter creates a contains filter for query on ranges of data in a collection index.
func NewEqualFilter ¶
NewEqualFilter creates a new equality filter instance for query.
func NewGeoRegionsContainingPointFilter ¶
NewGeoRegionsContainingPointFilter creates a geospatial "containing point" filter for query. Argument must be a valid GeoJSON point.
func NewGeoRegionsContainingPointForCollectionFilter ¶
func NewGeoRegionsContainingPointForCollectionFilter(binName string, collectionType IndexCollectionType, point string) *Filter
NewGeoRegionsContainingPointForCollectionFilter creates a geospatial "containing point" filter for query on collection index. Argument must be a valid GeoJSON point.
func NewGeoWithinRadiusFilter ¶
NewGeoWithinRadiusFilter creates a geospatial "within radius" filter for query. Arguments must be valid longitude/latitude/radius (meters) values.
func NewGeoWithinRadiusForCollectionFilter ¶
func NewGeoWithinRadiusForCollectionFilter(binName string, collectionType IndexCollectionType, lng, lat, radius float64) *Filter
NewGeoWithinRadiusForCollectionFilter creates a geospatial "within radius" filter for query on collection index. Arguments must be valid longitude/latitude/radius (meters) values.
func NewGeoWithinRegionFilter ¶
NewGeoWithinRegionFilter creates a geospatial "within region" filter for query. Argument must be a valid GeoJSON region.
func NewGeoWithinRegionForCollectionFilter ¶
func NewGeoWithinRegionForCollectionFilter(binName string, collectionType IndexCollectionType, region string) *Filter
NewGeoWithinRegionForCollectionFilter creates a geospatial "within region" filter for query on collection index. Argument must be a valid GeoJSON region.
func NewRangeFilter ¶
NewRangeFilter creates a range filter for query. Range arguments must be int64 values. String ranges are not supported.
func (*Filter) EstimateSize ¶
EstimateSize will estimate the size of the filter for wire protocol
func (*Filter) IndexCollectionType ¶
func (fltr *Filter) IndexCollectionType() IndexCollectionType
IndexCollectionType returns filter's index type.
type FilterExpression ¶
type FilterExpression struct {
// contains filtered or unexported fields
}
FilterExpression which can be applied to most commands, to control which records are affected by the command. Filter expression are created using the functions in the [expressions](crate::expressions) module and its submodules.
func ExpAnd ¶
func ExpAnd(exps ...*FilterExpression) *FilterExpression
ExpAnd creates a "and" (&&) operator that applies to a variable number of expressions.
func ExpBinExists ¶
func ExpBinExists(name string) *FilterExpression
ExpBinExists creates a function that returns if bin of specified name exists.
func ExpBinType ¶
func ExpBinType(name string) *FilterExpression
ExpBinType creates a function that returns bin's integer particle type.
func ExpBitAdd ¶
func ExpBitAdd( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, value *FilterExpression, signed bool, action BitOverflowAction, bin *FilterExpression, ) *FilterExpression
ExpBitAdd creates an expression that adds value to byte[] bin starting at bitOffset for bitSize and returns byte[]. `BitSize` must be <= 64. Signed indicates if bits should be treated as a signed number. If add overflows/underflows, `BitOverflowAction` is used.
func ExpBitAnd ¶
func ExpBitAnd( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, value *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitAnd creates an expression that performs bitwise "and" on value and byte[] bin at bitOffset for bitSize and returns byte[].
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 23 bitSize = 9 value = [0b00111100, 0b10000000] bin result = [0b00000001, 0b01000010, 0b00000010, 0b00000000, 0b00000101]
func ExpBitCount ¶
func ExpBitCount( bitOffset *FilterExpression, bitSize *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitCount creates an expression that returns integer count of set bits from byte[] bin starting at bitOffset for bitSize.
func ExpBitGet ¶
func ExpBitGet( bitOffset *FilterExpression, bitSize *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitGet creates an expression that returns bits from byte[] bin starting at bitOffset for bitSize.
func ExpBitGetInt ¶
func ExpBitGetInt( bitOffset *FilterExpression, bitSize *FilterExpression, signed bool, bin *FilterExpression, ) *FilterExpression
ExpBitGetInt Create expression that returns integer from byte[] bin starting at bitOffset for bitSize. Signed indicates if bits should be treated as a signed number.
func ExpBitInsert ¶
func ExpBitInsert( policy *BitPolicy, byteOffset *FilterExpression, value *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitInsert creates an expression that inserts value bytes into byte[] bin at byteOffset and returns byte[].
func ExpBitLScan ¶
func ExpBitLScan( bitOffset *FilterExpression, bitSize *FilterExpression, value *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitLScan creates an expression that returns integer bit offset of the first specified value bit in byte[] bin starting at bitOffset for bitSize.
func ExpBitLShift ¶
func ExpBitLShift( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, shift *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitLShift creates an expression that shifts left byte[] bin starting at bitOffset for bitSize and returns byte[].
func ExpBitNot ¶
func ExpBitNot( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitNot creates an expression that negates byte[] bin starting at bitOffset for bitSize and returns byte[].
func ExpBitOr ¶
func ExpBitOr( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, value *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitOr creates an expression that performs bitwise "or" on value and byte[] bin at bitOffset for bitSize and returns byte[].
func ExpBitRScan ¶
func ExpBitRScan( bitOffset *FilterExpression, bitSize *FilterExpression, value *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitRScan creates an expression that returns integer bit offset of the last specified value bit in byte[] bin starting at bitOffset for bitSize.
func ExpBitRShift ¶
func ExpBitRShift( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, shift *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitRShift creates an expression that shifts right byte[] bin starting at bitOffset for bitSize and returns byte[].
func ExpBitRemove ¶
func ExpBitRemove( policy *BitPolicy, byteOffset *FilterExpression, byteSize *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitRemove creates an expression that removes bytes from byte[] bin at byteOffset for byteSize and returns byte[].
func ExpBitResize ¶
func ExpBitResize( policy *BitPolicy, byteSize *FilterExpression, resizeFlags BitResizeFlags, bin *FilterExpression, ) *FilterExpression
ExpBitResize creates an expression that resizes byte[] to byteSize according to resizeFlags and returns byte[].
func ExpBitSet ¶
func ExpBitSet( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, value *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitSet creates an expression that sets value on byte[] bin at bitOffset for bitSize and returns byte[].
func ExpBitSetInt ¶
func ExpBitSetInt( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, value *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitSetInt creates an expression that sets value to byte[] bin starting at bitOffset for bitSize and returns byte[]. `BitSize` must be <= 64.
func ExpBitSubtract ¶
func ExpBitSubtract( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, value *FilterExpression, signed bool, action BitOverflowAction, bin *FilterExpression, ) *FilterExpression
ExpBitSubtract creates an expression that subtracts value from byte[] bin starting at bitOffset for bitSize and returns byte[]. `BitSize` must be <= 64. Signed indicates if bits should be treated as a signed number. If add overflows/underflows, `BitOverflowAction` is used.
func ExpBitXor ¶
func ExpBitXor( policy *BitPolicy, bitOffset *FilterExpression, bitSize *FilterExpression, value *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpBitXor creates an expression that performs bitwise "xor" on value and byte[] bin at bitOffset for bitSize and returns byte[].
func ExpBlobBin ¶
func ExpBlobBin(name string) *FilterExpression
ExpBlobBin creates a blob bin expression.
func ExpDeviceSize ¶
func ExpDeviceSize() *FilterExpression
ExpDeviceSize creates a function that returns record size on disk. If server storage-engine is memory, then zero is returned.
func ExpDigestModulo ¶
func ExpDigestModulo(modulo int64) *FilterExpression
ExpDigestModulo creates a function that returns record digest modulo as integer.
func ExpEq ¶
func ExpEq(left *FilterExpression, right *FilterExpression) *FilterExpression
ExpEq creates a equal (==) expression.
func ExpFloatBin ¶
func ExpFloatBin(name string) *FilterExpression
ExpFloatBin creates a 64 bit float bin expression.
func ExpFloatVal ¶
func ExpFloatVal(val float64) *FilterExpression
ExpFloatVal creates a 64 bit float bin value
func ExpGeoBin ¶
func ExpGeoBin(name string) *FilterExpression
ExpGeoBin creates a geo bin expression.
func ExpGeoCompare ¶
func ExpGeoCompare(left *FilterExpression, right *FilterExpression) *FilterExpression
ExpGeoCompare creates a compare geospatial operation.
func ExpGeoVal ¶
func ExpGeoVal(val string) *FilterExpression
ExpGeoVal creates a geospatial json string value.
func ExpGreater ¶
func ExpGreater(left *FilterExpression, right *FilterExpression) *FilterExpression
ExpGreater creates a greater than (>) operation.
func ExpGreaterEq ¶
func ExpGreaterEq(left *FilterExpression, right *FilterExpression) *FilterExpression
ExpGreaterEq creates a greater than or equal (>=) operation.
func ExpHLLAdd ¶
func ExpHLLAdd(policy *HLLPolicy, list *FilterExpression, bin *FilterExpression) *FilterExpression
ExpHLLAdd creates an expression that adds list values to a HLL set and returns HLL set. The function assumes HLL bin already exists.
func ExpHLLAddWithIndex ¶
func ExpHLLAddWithIndex( policy *HLLPolicy, list *FilterExpression, indexBitCount *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpHLLAddWithIndex creates an expression that adds values to a HLL set and returns HLL set. If HLL bin does not exist, use `indexBitCount` to create HLL bin.
func ExpHLLAddWithIndexAndMinHash ¶
func ExpHLLAddWithIndexAndMinHash( policy *HLLPolicy, list *FilterExpression, indexBitCount *FilterExpression, minHashCount *FilterExpression, bin *FilterExpression, ) *FilterExpression
ExpHLLAddWithIndexAndMinHash creates an expression that adds values to a HLL set and returns HLL set. If HLL bin does not exist, use `indexBitCount` and `minHashBitCount` to create HLL set.
func ExpHLLBin ¶
func ExpHLLBin(name string) *FilterExpression
ExpHLLBin creates a a HLL bin expression
func ExpHLLDescribe ¶
func ExpHLLDescribe(bin *FilterExpression) *FilterExpression
ExpHLLDescribe creates an expression that returns `indexBitCount` and `minHashBitCount` used to create HLL bin in a list of longs. `list[0]` is `indexBitCount` and `list[1]` is `minHashBitCount`.
func ExpHLLGetCount ¶
func ExpHLLGetCount(bin *FilterExpression) *FilterExpression
ExpHLLGetCount creates an expression that returns estimated number of elements in the HLL bin.
func ExpHLLGetIntersectCount ¶
func ExpHLLGetIntersectCount(list *FilterExpression, bin *FilterExpression) *FilterExpression
ExpHLLGetIntersectCount creates an expression that returns estimated number of elements that would be contained by the intersection of these HLL objects.
func ExpHLLGetSimilarity ¶
func ExpHLLGetSimilarity(list *FilterExpression, bin *FilterExpression) *FilterExpression
ExpHLLGetSimilarity creates an expression that returns estimated similarity of these HLL objects as a 64 bit float.
func ExpHLLGetUnion ¶
func ExpHLLGetUnion(list *FilterExpression, bin *FilterExpression) *FilterExpression
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.
func ExpHLLGetUnionCount ¶
func ExpHLLGetUnionCount(list *FilterExpression, bin *FilterExpression) *FilterExpression
ExpHLLGetUnionCount creates an expression that returns estimated number of elements that would be contained by the union of these HLL objects.
func ExpHLLMayContain ¶
func ExpHLLMayContain(list *FilterExpression, bin *FilterExpression) *FilterExpression
ExpHLLMayContain creates an expression that returns one if HLL bin may contain all items in the list.
func ExpIntBin ¶
func ExpIntBin(name string) *FilterExpression
ExpIntBin creates a 64 bit int bin expression.
func ExpIntVal ¶
func ExpIntVal(val int64) *FilterExpression
ExpIntVal creates a 64 bit integer value
func ExpIsTombstone ¶
func ExpIsTombstone() *FilterExpression
ExpIsTombstone creates a expression that returns if record has been deleted and is still in tombstone state. This expression usually evaluates quickly because record meta data is cached in memory.
func ExpKey ¶
func ExpKey(expType ExpType) *FilterExpression
ExpKey creates a record key expression of specified type.
func ExpKeyExists ¶
func ExpKeyExists() *FilterExpression
ExpKeyExists creates a function that returns if the primary key is stored in the record meta data as a boolean expression. This would occur when `send_key` is true on record write.
func ExpLastUpdate ¶
func ExpLastUpdate() *FilterExpression
ExpLastUpdate creates a function that returns record last update time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.
func ExpLess ¶
func ExpLess(left *FilterExpression, right *FilterExpression) *FilterExpression
ExpLess creates a less than (<) operation.
func ExpLessEq ¶
func ExpLessEq(left *FilterExpression, right *FilterExpression) *FilterExpression
ExpLessEq creates a less than or equals (<=) operation.
func ExpListAppend ¶
func ExpListAppend( policy *ListPolicy, value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListAppend creates an expression that appends value to end of list.
func ExpListAppendItems ¶
func ExpListAppendItems( policy *ListPolicy, list *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListAppendItems creates an expression that appends list items to end of list.
func ExpListBin ¶
func ExpListBin(name string) *FilterExpression
ExpListBin creates a list bin expression.
func ExpListClear ¶
func ExpListClear(bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
ExpListClear creates an expression that removes all items in list.
func ExpListGetByIndex ¶
func ExpListGetByIndex( returnType ListReturnType, value_type ExpType, index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByIndex creates an expression that selects list item identified by index and returns selected data specified by returnType.
func ExpListGetByIndexRange ¶
func ExpListGetByIndexRange( returnType ListReturnType, index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByIndexRange creates an expression that selects list items starting at specified index to the end of list and returns selected data specified by returnType .
func ExpListGetByIndexRangeCount ¶
func ExpListGetByIndexRangeCount( returnType ListReturnType, index *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByIndexRangeCount creates an expression that selects "count" list items starting at specified index and returns selected data specified by returnType.
func ExpListGetByRank ¶
func ExpListGetByRank( returnType ListReturnType, value_type ExpType, rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByRank creates an expression that selects list item identified by rank and returns selected data specified by returnType.
func ExpListGetByRankRange ¶
func ExpListGetByRankRange( returnType ListReturnType, rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByRankRange creates an expression that selects list items starting at specified rank to the last ranked item and returns selected data specified by returnType.
func ExpListGetByRankRangeCount ¶
func ExpListGetByRankRangeCount( returnType ListReturnType, rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByRankRangeCount creates an expression that selects "count" list items starting at specified rank and returns selected data specified by returnType.
func ExpListGetByValue ¶
func ExpListGetByValue( returnType ListReturnType, value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByValue creates an expression that selects list items identified by value and returns selected data specified by returnType.
func ExpListGetByValueList ¶
func ExpListGetByValueList( returnType ListReturnType, values *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByValueList creates an expression that selects list items identified by values and returns selected data specified by returnType.
func ExpListGetByValueRange ¶
func ExpListGetByValueRange( returnType ListReturnType, valueBegin *FilterExpression, valueEnd *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByValueRange creates an expression that selects list items identified by value range and returns selected data specified by returnType.
func ExpListGetByValueRelativeRankRange ¶
func ExpListGetByValueRelativeRankRange( returnType ListReturnType, value *FilterExpression, rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListGetByValueRelativeRankRange creates an expression that selects list items nearest to value and greater by relative rank and returns selected data specified by returnType.
Examples for ordered list \[0, 4, 5, 9, 11, 15\]:
(value,rank) = [selected items] (5,0) = [5,9,11,15] (5,1) = [9,11,15] (5,-1) = [4,5,9,11,15] (3,0) = [4,5,9,11,15] (3,3) = [11,15] (3,-3) = [0,4,5,9,11,15]
func ExpListGetByValueRelativeRankRangeCount ¶
func ExpListGetByValueRelativeRankRangeCount( returnType ListReturnType, value *FilterExpression, rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
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.
Examples for ordered list \[0, 4, 5, 9, 11, 15\]:
(value,rank,count) = [selected items] (5,0,2) = [5,9] (5,1,1) = [9] (5,-1,2) = [4,5] (3,0,1) = [4] (3,3,7) = [11,15] (3,-3,2) = []
func ExpListIncrement ¶
func ExpListIncrement( policy *ListPolicy, index *FilterExpression, value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListIncrement creates an expression that increments `list[index]` by value. Value expression should resolve to a number.
func ExpListInsert ¶
func ExpListInsert( policy *ListPolicy, index *FilterExpression, value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListInsert creates an expression that inserts value to specified index of list.
func ExpListInsertItems ¶
func ExpListInsertItems( policy *ListPolicy, index *FilterExpression, list *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListInsertItems creates an expression that inserts each input list item starting at specified index of list.
func ExpListRemoveByIndex ¶
func ExpListRemoveByIndex( index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByIndex creates an expression that removes list item identified by index.
func ExpListRemoveByIndexRange ¶
func ExpListRemoveByIndexRange( index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByIndexRange creates an expression that removes list items starting at specified index to the end of list.
func ExpListRemoveByIndexRangeCount ¶
func ExpListRemoveByIndexRangeCount( index *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByIndexRangeCount creates an expression that removes "count" list items starting at specified index.
func ExpListRemoveByRank ¶
func ExpListRemoveByRank( rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByRank creates an expression that removes list item identified by rank.
func ExpListRemoveByRankRange ¶
func ExpListRemoveByRankRange( rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByRankRange creates an expression that removes list items starting at specified rank to the last ranked item.
func ExpListRemoveByRankRangeCount ¶
func ExpListRemoveByRankRangeCount( rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByRankRangeCount creates an expression that removes "count" list items starting at specified rank.
func ExpListRemoveByValue ¶
func ExpListRemoveByValue( value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByValue creates an expression that removes list items identified by value.
func ExpListRemoveByValueList ¶
func ExpListRemoveByValueList( values *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByValueList creates an expression that removes list items identified by values.
func ExpListRemoveByValueRange ¶
func ExpListRemoveByValueRange( valueBegin *FilterExpression, valueEnd *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByValueRange creates an expression that removes list items identified by value range (valueBegin inclusive, valueEnd exclusive). If valueBegin is null, the range is less than valueEnd. If valueEnd is null, the range is greater than equal to valueBegin.
func ExpListRemoveByValueRelativeRankRange ¶
func ExpListRemoveByValueRelativeRankRange( value *FilterExpression, rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByValueRelativeRankRange creates an expression that removes list items nearest to value and greater by relative rank.
Examples for ordered list \[0, 4, 5, 9, 11, 15\]:
(value,rank) = [removed items] (5,0) = [5,9,11,15] (5,1) = [9,11,15] (5,-1) = [4,5,9,11,15] (3,0) = [4,5,9,11,15] (3,3) = [11,15] (3,-3) = [0,4,5,9,11,15]
func ExpListRemoveByValueRelativeRankRangeCount ¶
func ExpListRemoveByValueRelativeRankRangeCount( value *FilterExpression, rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListRemoveByValueRelativeRankRangeCount creates an expression that removes list items nearest to value and greater by relative rank with a count limit.
Examples for ordered list \[0, 4, 5, 9, 11, 15\]:
(value,rank,count) = [removed items] (5,0,2) = [5,9] (5,1,1) = [9] (5,-1,2) = [4,5] (3,0,1) = [4] (3,3,7) = [11,15] (3,-3,2) = []
func ExpListSet ¶
func ExpListSet( policy *ListPolicy, index *FilterExpression, value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListSet creates an expression that sets item value at specified index in list.
func ExpListSize ¶
func ExpListSize(bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
ExpListSize creates an expression that returns list size.
func ExpListSort ¶
func ExpListSort( sortFlags ListSortFlags, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpListSort creates an expression that sorts list according to sortFlags.
func ExpListVal ¶
func ExpListVal(val ...Value) *FilterExpression
ExpListVal creates a List bin Value
func ExpListValueVal ¶
func ExpListValueVal(val ...interface{}) *FilterExpression
ExpListValueVal creates a List bin Value
func ExpMapBin ¶
func ExpMapBin(name string) *FilterExpression
ExpMapBin creates a map bin expression.
func ExpMapClear ¶
func ExpMapClear(bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
ExpMapClear creates an expression that removes all items in map.
func ExpMapGetByIndex ¶
func ExpMapGetByIndex( returnType mapReturnType, valueType ExpType, index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByIndex creates an expression that selects map item identified by index and returns selected data specified by returnType.
func ExpMapGetByIndexRange ¶
func ExpMapGetByIndexRange( returnType mapReturnType, index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByIndexRange creates an expression that selects map items starting at specified index to the end of map and returns selected data specified by returnType.
func ExpMapGetByIndexRangeCount ¶
func ExpMapGetByIndexRangeCount( returnType mapReturnType, index *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByIndexRangeCount creates an expression that selects "count" map items starting at specified index and returns selected data specified by returnType.
func ExpMapGetByKey ¶
func ExpMapGetByKey( returnType mapReturnType, valueType ExpType, key *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByKey creates an expression that selects map item identified by key and returns selected data specified by returnType.
func ExpMapGetByKeyList ¶
func ExpMapGetByKeyList( returnType mapReturnType, keys *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByKeyList creates an expression that selects map items identified by keys and returns selected data specified by returnType
func ExpMapGetByKeyRange ¶
func ExpMapGetByKeyRange( returnType mapReturnType, keyBegin *FilterExpression, keyEnd *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByKeyRange creates an expression that selects map items identified by key range (keyBegin inclusive, keyEnd exclusive). If keyBegin is null, the range is less than keyEnd. If keyEnd is null, the range is greater than equal to keyBegin. Expression returns selected data specified by returnType.
func ExpMapGetByKeyRelativeIndexRange ¶
func ExpMapGetByKeyRelativeIndexRange( returnType mapReturnType, key *FilterExpression, index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByKeyRelativeIndexRange creates an expression that selects map items nearest to key and greater by index. Expression returns selected data specified by returnType.
Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
* (value,index) = [selected items] * (5,0) = [{5=15},{9=10}] * (5,1) = [{9=10}] * (5,-1) = [{4=2},{5=15},{9=10}] * (3,2) = [{9=10}] * (3,-2) = [{0=17},{4=2},{5=15},{9=10}]
func ExpMapGetByKeyRelativeIndexRangeCount ¶
func ExpMapGetByKeyRelativeIndexRangeCount( returnType mapReturnType, key *FilterExpression, index *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByKeyRelativeIndexRangeCount creates an expression that selects map items nearest to key and greater by index with a count limit. Expression returns selected data specified by returnType.
Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
* (value,index,count) = [selected items] * (5,0,1) = [{5=15}] * (5,1,2) = [{9=10}] * (5,-1,1) = [{4=2}] * (3,2,1) = [{9=10}] * (3,-2,2) = [{0=17}]
func ExpMapGetByRank ¶
func ExpMapGetByRank( returnType mapReturnType, valueType ExpType, rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByRank creates an expression that selects map item identified by rank and returns selected data specified by returnType.
func ExpMapGetByRankRange ¶
func ExpMapGetByRankRange( returnType mapReturnType, rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByRankRange creates an expression that selects map items starting at specified rank to the last ranked item and returns selected data specified by returnType.
func ExpMapGetByRankRangeCount ¶
func ExpMapGetByRankRangeCount( returnType mapReturnType, rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByRankRangeCount creates an expression that selects "count" map items starting at specified rank and returns selected data specified by returnType.
func ExpMapGetByValue ¶
func ExpMapGetByValue( returnType mapReturnType, value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByValue creates an expression that selects map items identified by value and returns selected data specified by returnType.
func ExpMapGetByValueList ¶
func ExpMapGetByValueList( returnType mapReturnType, values *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByValueList creates an expression that selects map items identified by values and returns selected data specified by returnType.
func ExpMapGetByValueRange ¶
func ExpMapGetByValueRange( returnType mapReturnType, valueBegin *FilterExpression, valueEnd *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
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. If valueEnd is null, the range is greater than equal to valueBegin.
Expression returns selected data specified by returnType.
func ExpMapGetByValueRelativeRankRange ¶
func ExpMapGetByValueRelativeRankRange( returnType mapReturnType, value *FilterExpression, rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByValueRelativeRankRange creates an expression that selects map items nearest to value and greater by relative rank. Expression returns selected data specified by returnType.
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
* (value,rank) = [selected items] * (11,1) = [{0=17}] * (11,-1) = [{9=10},{5=15},{0=17}]
func ExpMapGetByValueRelativeRankRangeCount ¶
func ExpMapGetByValueRelativeRankRangeCount( returnType mapReturnType, value *FilterExpression, rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapGetByValueRelativeRankRangeCount creates an expression that selects map items nearest to value and greater by relative rank with a count limit. Expression returns selected data specified by returnType.
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
* (value,rank,count) = [selected items] * (11,1,1) = [{0=17}] * (11,-1,1) = [{9=10}]
func ExpMapIncrement ¶
func ExpMapIncrement( policy *MapPolicy, key *FilterExpression, incr *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapIncrement creates an expression that increments values by incr for all items identified by key. Valid only for numbers.
func ExpMapPut ¶
func ExpMapPut( policy *MapPolicy, key *FilterExpression, value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapPut creates an expression that writes key/value item to map bin.
func ExpMapPutItems ¶
func ExpMapPutItems( policy *MapPolicy, amap *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapPutItems creates an expression that writes each map item to map bin.
func ExpMapRemoveByIndex ¶
func ExpMapRemoveByIndex( index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByIndex creates an expression that removes map item identified by index.
func ExpMapRemoveByIndexRange ¶
func ExpMapRemoveByIndexRange( index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByIndexRange creates an expression that removes map items starting at specified index to the end of map.
func ExpMapRemoveByIndexRangeCount ¶
func ExpMapRemoveByIndexRangeCount( index *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByIndexRangeCount creates an expression that removes "count" map items starting at specified index.
func ExpMapRemoveByKey ¶
func ExpMapRemoveByKey( key *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByKey creates an expression that removes map item identified by key.
func ExpMapRemoveByKeyList ¶
func ExpMapRemoveByKeyList( keys *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByKeyList creates an expression that removes map items identified by keys.
func ExpMapRemoveByKeyRange ¶
func ExpMapRemoveByKeyRange( keyBegin *FilterExpression, keyEnd *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByKeyRange creates an expression that removes map items identified by key range (keyBegin inclusive, keyEnd exclusive). If keyBegin is null, the range is less than keyEnd. If keyEnd is null, the range is greater than equal to keyBegin.
func ExpMapRemoveByKeyRelativeIndexRange ¶
func ExpMapRemoveByKeyRelativeIndexRange( key *FilterExpression, index *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByKeyRelativeIndexRange creates an expression that removes map items nearest to key and greater by index.
Examples for map [{0=17},{4=2},{5=15},{9=10}]:
* (value,index) = [removed items] * (5,0) = [{5=15},{9=10}] * (5,1) = [{9=10}] * (5,-1) = [{4=2},{5=15},{9=10}] * (3,2) = [{9=10}] * (3,-2) = [{0=17},{4=2},{5=15},{9=10}]
func ExpMapRemoveByKeyRelativeIndexRangeCount ¶
func ExpMapRemoveByKeyRelativeIndexRangeCount( key *FilterExpression, index *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByKeyRelativeIndexRangeCount creates an expression that removes map items nearest to key and greater by index with a count limit.
Examples for map [{0=17},{4=2},{5=15},{9=10}]:
(value,index,count) = [removed items] * (5,0,1) = [{5=15}] * (5,1,2) = [{9=10}] * (5,-1,1) = [{4=2}] * (3,2,1) = [{9=10}] * (3,-2,2) = [{0=17}]
func ExpMapRemoveByRank ¶
func ExpMapRemoveByRank( rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByRank creates an expression that removes map item identified by rank.
func ExpMapRemoveByRankRange ¶
func ExpMapRemoveByRankRange( rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByRankRange creates an expression that removes map items starting at specified rank to the last ranked item.
func ExpMapRemoveByRankRangeCount ¶
func ExpMapRemoveByRankRangeCount( rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByRankRangeCount creates an expression that removes "count" map items starting at specified rank.
func ExpMapRemoveByValue ¶
func ExpMapRemoveByValue( value *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByValue creates an expression that removes map items identified by value.
func ExpMapRemoveByValueList ¶
func ExpMapRemoveByValueList( values *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByValueList creates an expression that removes map items identified by values.
func ExpMapRemoveByValueRange ¶
func ExpMapRemoveByValueRange( valueBegin *FilterExpression, valueEnd *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByValueRange creates an expression that removes map items identified by value range (valueBegin inclusive, valueEnd exclusive). If valueBegin is null, the range is less than valueEnd. If valueEnd is null, the range is greater than equal to valueBegin.
func ExpMapRemoveByValueRelativeRankRange ¶
func ExpMapRemoveByValueRelativeRankRange( value *FilterExpression, rank *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByValueRelativeRankRange creates an expression that removes map items nearest to value and greater by relative rank.
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
* (value,rank) = [removed items] * (11,1) = [{0=17}] * (11,-1) = [{9=10},{5=15},{0=17}]
func ExpMapRemoveByValueRelativeRankRangeCount ¶
func ExpMapRemoveByValueRelativeRankRangeCount( value *FilterExpression, rank *FilterExpression, count *FilterExpression, bin *FilterExpression, ctx ...*CDTContext, ) *FilterExpression
ExpMapRemoveByValueRelativeRankRangeCount creates an expression that removes map items nearest to value and greater by relative rank with a count limit.
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
* (value,rank,count) = [removed items] * (11,1,1) = [{0=17}] * (11,-1,1) = [{9=10}]
func ExpMapSize ¶
func ExpMapSize(bin *FilterExpression, ctx ...*CDTContext) *FilterExpression
ExpMapSize creates an expression that returns list size.
func ExpMemorySize ¶
func ExpMemorySize() *FilterExpression
ExpMemorySize creates expression that returns record size in memory. If server storage-engine is not memory nor data-in-memory, then zero is returned. This expression usually evaluates quickly because record meta data is cached in memory.
func ExpNot ¶
func ExpNot(exp *FilterExpression) *FilterExpression
ExpNot creates a "not" operator expression.
func ExpNotEq ¶
func ExpNotEq(left *FilterExpression, right *FilterExpression) *FilterExpression
ExpNotEq creates a not equal (!=) expression
func ExpOr ¶
func ExpOr(exps ...*FilterExpression) *FilterExpression
ExpOr creates a "or" (||) operator that applies to a variable number of expressions.
func ExpRegexCompare ¶
func ExpRegexCompare(regex string, flags ExpRegexFlags, bin *FilterExpression) *FilterExpression
ExpRegexCompare creates a function like regular expression string operation.
func ExpSetName ¶
func ExpSetName() *FilterExpression
ExpSetName creates a function that returns record set name string.
func ExpSinceUpdate ¶
func ExpSinceUpdate() *FilterExpression
ExpSinceUpdate creates a expression that returns milliseconds since the record was last updated. This expression usually evaluates quickly because record meta data is cached in memory.
func ExpStringBin ¶
func ExpStringBin(name string) *FilterExpression
ExpStringBin creates a string bin expression.
func ExpStringVal ¶
func ExpStringVal(val string) *FilterExpression
ExpStringVal creates a String bin value
func ExpTTL ¶
func ExpTTL() *FilterExpression
ExpTTL creates a function that returns record expiration time (time to live) in integer seconds.
func ExpValueArrayVal ¶
func ExpValueArrayVal(val ValueArray) *FilterExpression
ExpValueArrayVal creates a List bin Value
func ExpVoidTime ¶
func ExpVoidTime() *FilterExpression
ExpVoidTime creates a function that returns record expiration time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.
type FloatValue ¶
type FloatValue float64
FloatValue encapsulates an float64 value.
func NewFloatValue ¶
func NewFloatValue(value float64) FloatValue
NewFloatValue generates a FloatValue instance.
func (FloatValue) EstimateSize ¶
func (vl FloatValue) EstimateSize() (int, error)
EstimateSize returns the size of the FloatValue in wire protocol.
func (FloatValue) GetObject ¶
func (vl FloatValue) GetObject() interface{}
GetObject returns original value as an interface{}.
func (FloatValue) GetType ¶
func (vl FloatValue) GetType() int
GetType returns wire protocol value type.
func (FloatValue) String ¶
func (vl FloatValue) String() string
String implements Stringer interface.
type GenerationPolicy ¶
type GenerationPolicy int
GenerationPolicy determines how to handle record writes based on record generation.
const ( // NONE means: Do not use record generation to restrict writes. NONE GenerationPolicy = iota // EXPECT_GEN_EQUAL means: Update/Delete record if expected generation is equal to server generation. Otherwise, fail. EXPECT_GEN_EQUAL // EXPECT_GEN_GT means: Update/Delete record if expected generation greater than the server generation. Otherwise, fail. // This is useful for restore after backup. EXPECT_GEN_GT )
type GeoJSONValue ¶
type GeoJSONValue string
GeoJSONValue encapsulates a 2D Geo point. Supported by Aerospike 3.6.1 servers and later only.
func NewGeoJSONValue ¶
func NewGeoJSONValue(value string) GeoJSONValue
NewGeoJSONValue generates a GeoJSONValue instance.
func (GeoJSONValue) EstimateSize ¶
func (vl GeoJSONValue) EstimateSize() (int, error)
EstimateSize returns the size of the GeoJSONValue in wire protocol.
func (GeoJSONValue) GetObject ¶
func (vl GeoJSONValue) GetObject() interface{}
GetObject returns original value as an interface{}.
func (GeoJSONValue) GetType ¶
func (vl GeoJSONValue) GetType() int
GetType returns wire protocol value type.
func (GeoJSONValue) String ¶
func (vl GeoJSONValue) String() string
String implements Stringer interface.
type HLLPolicy ¶
type HLLPolicy struct {
// contains filtered or unexported fields
}
HLLPolicy determines the HyperLogLog operation policy.
func DefaultHLLPolicy ¶
func DefaultHLLPolicy() *HLLPolicy
DefaultHLLPolicy uses the default policy when performing HLL operations.
func NewHLLPolicy ¶
NewHLLPolicy uses specified HLLWriteFlags when performing HLL operations.
type HLLValue ¶
type HLLValue []byte
HLLValue encapsulates a HyperLogLog value.
func NewHLLValue ¶
NewHLLValue generates a ByteValue instance.
func (HLLValue) EstimateSize ¶
EstimateSize returns the size of the HLLValue in wire protocol.
func (HLLValue) GetObject ¶
func (vl HLLValue) GetObject() interface{}
GetObject returns original value as an interface{}.
type Host ¶
type Host struct { // Host name or IP address of database server. Name string //TLSName defines the TLS certificate name used for secure connections. TLSName string // Port of database server. Port int }
Host name/port of database server.
type IndexCollectionType ¶
type IndexCollectionType int
IndexCollectionType is the secondary index collection type.
const ( // ICT_DEFAULT is the Normal scalar index. ICT_DEFAULT IndexCollectionType = iota // ICT_LIST is Index list elements. ICT_LIST // ICT_MAPKEYS is Index map keys. ICT_MAPKEYS // ICT_MAPVALUES is Index map values. ICT_MAPVALUES )
type IndexTask ¶
type IndexTask struct {
// contains filtered or unexported fields
}
IndexTask is used to poll for long running create index completion.
func NewIndexTask ¶
NewIndexTask initializes a task with fields needed to query server nodes.
func (*IndexTask) OnComplete ¶
OnComplete returns a channel that will be closed as soon as the task is finished. If an error is encountered during operation, an error will be sent on the channel.
type InfinityValue ¶
type InfinityValue struct{}
InfinityValue is an empty value.
func NewInfinityValue ¶
func NewInfinityValue() InfinityValue
NewInfinityValue generates a InfinityValue instance.
func (InfinityValue) EstimateSize ¶
func (vl InfinityValue) EstimateSize() (int, error)
EstimateSize returns the size of the InfinityValue in wire protocol.
func (InfinityValue) GetObject ¶
func (vl InfinityValue) GetObject() interface{}
GetObject returns original value as an interface{}.
func (InfinityValue) GetType ¶
func (vl InfinityValue) GetType() int
GetType returns wire protocol value type.
func (InfinityValue) String ¶
func (vl InfinityValue) String() string
type InfoPolicy ¶
type InfoPolicy struct { // Info command socket timeout. // Default is 2 seconds. Timeout time.Duration }
InfoPolicy contains attributes used for info commands.
func NewInfoPolicy ¶
func NewInfoPolicy() *InfoPolicy
NewInfoPolicy generates a new InfoPolicy with default values.
type IntegerValue ¶
type IntegerValue int
IntegerValue encapsulates an integer value.
func NewIntegerValue ¶
func NewIntegerValue(value int) IntegerValue
NewIntegerValue generates an IntegerValue instance.
func (IntegerValue) EstimateSize ¶
func (vl IntegerValue) EstimateSize() (int, error)
EstimateSize returns the size of the IntegerValue in wire protocol.
func (IntegerValue) GetObject ¶
func (vl IntegerValue) GetObject() interface{}
GetObject returns original value as an interface{}.
func (IntegerValue) GetType ¶
func (vl IntegerValue) GetType() int
GetType returns wire protocol value type.
func (IntegerValue) String ¶
func (vl IntegerValue) String() string
String implements Stringer interface.
type JsonValue ¶
type JsonValue map[string]interface{}
JsonValue encapsulates a Json map. Supported by Aerospike 3+ servers only.
func NewJsonValue ¶
NewJsonValue generates a JsonValue instance.
func (JsonValue) EstimateSize ¶
EstimateSize returns the size of the JsonValue in wire protocol.
func (JsonValue) GetObject ¶
func (vl JsonValue) GetObject() interface{}
GetObject returns original value as an interface{}.
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is the unique record identifier. Records can be identified using a specified namespace, an optional set name, and a user defined key which must be unique within a set. Records can also be identified by namespace/digest which is the combination used on the server.
func NewKey ¶
NewKey initializes a key from namespace, optional set name and user key. The set name and user defined key are converted to a digest before sending to the server. The server handles record identifiers by digest only.
func NewKeyWithDigest ¶
func NewKeyWithDigest(namespace string, setName string, key interface{}, digest []byte) (*Key, error)
NewKeyWithDigest initializes a key from namespace, optional set name and user key. The server handles record identifiers by digest only.
func (*Key) PartitionId ¶
PartitionId returns the partition that the key belongs to.
func (*Key) SetValue ¶
SetValue sets the Key's value and recompute's its digest without allocating new memory. This allows the keys to be reusable.
type Language ¶
type Language string
Language specifies User defined function languages.
const ( // LUA embedded programming language. LUA Language = "LUA" )
type ListIter ¶
ListIter allows to define general maps of your own type to be used in the Go client without the use of reflection. function PackList should be exactly Like the following (Do not change, just copy/paste and adapt PackXXX methods):
func (cs *CustomSlice) PackList(buf aerospike.BufferEx) (int, error) { size := 0 for _, elem := range cs { n, err := PackXXX(buf, elem) size += n if err != nil { return size, err } } return size, nil }
Example (Int) ¶
package main import ( "fmt" "log" as "github.com/aerospike/aerospike-client-go/v4" ) /* myListInt */ var _ as.ListIter = myListInt([]int{}) // your custom list type myListInt []int func (ml myListInt) PackList(buf as.BufferEx) (int, error) { size := 0 for _, elem := range ml { n, err := as.PackInt64(buf, int64(elem)) size += n if err != nil { return size, err } } return size, nil } func (ml myListInt) Len() int { return len(ml) } func main() { // Setup the client here // client, err := as.NewClient("127.0.0.1", 3000) // if err != nil { // log.Fatal(err) // } var v as.Value = as.NewValue(myListInt([]int{1, 2, 3})) key, err := as.NewKey("test", "test", 1) if err != nil { log.Fatal(err) } err = client.Put(nil, key, as.BinMap{"myBin": v}) if err != nil { log.Fatal(err) } rec, err := client.Get(nil, key) if err != nil { log.Fatal(err) } fmt.Println(rec.Bins["myBin"]) }
Output: [1 2 3]
Example (String) ¶
package main import ( "fmt" "log" as "github.com/aerospike/aerospike-client-go/v4" ) /* myListString */ var _ as.ListIter = myListString([]string{}) // your custom list type myListString []string func (ml myListString) PackList(buf as.BufferEx) (int, error) { size := 0 for _, elem := range ml { n, err := as.PackString(buf, elem) size += n if err != nil { return size, err } } return size, nil } func (ml myListString) Len() int { return len(ml) } func main() { // Setup the client here // client, err := as.NewClient("127.0.0.1", 3000) // if err != nil { // log.Fatal(err) // } var v as.Value = as.NewValue(myListString([]string{"a", "b", "c"})) key, err := as.NewKey("test", "test", 1) if err != nil { log.Fatal(err) } err = client.Put(nil, key, as.BinMap{"myBin": v}) if err != nil { log.Fatal(err) } rec, err := client.Get(nil, key) if err != nil { log.Fatal(err) } fmt.Println(rec.Bins["myBin"]) }
Output: [a b c]
Example (Time) ¶
package main import ( "fmt" "log" "time" as "github.com/aerospike/aerospike-client-go/v4" ) /* myListTime */ var _ as.ListIter = myListTime([]time.Time{}) // your custom list type myListTime []time.Time func (ml myListTime) PackList(buf as.BufferEx) (int, error) { size := 0 for _, elem := range ml { n, err := as.PackInt64(buf, elem.UnixNano()) size += n if err != nil { return size, err } } return size, nil } func (ml myListTime) Len() int { return len(ml) } func main() { // Setup the client here // client, err := as.NewClient("127.0.0.1", 3000) // if err != nil { // log.Fatal(err) // } now1 := time.Unix(123123123, 0) now2 := time.Unix(123123124, 0) now3 := time.Unix(123123125, 0) var v as.Value = as.NewValue(myListTime([]time.Time{now1, now2, now3})) key, err := as.NewKey("test", "test", 1) if err != nil { log.Fatal(err) } err = client.Put(nil, key, as.BinMap{"myBin": v}) if err != nil { log.Fatal(err) } rec, err := client.Get(nil, key) if err != nil { log.Fatal(err) } fmt.Println(rec.Bins["myBin"]) }
Output: [123123123000000000 123123124000000000 123123125000000000]
type ListOrderType ¶
type ListOrderType int
ListOrderType determines the order of returned values in CDT list operations.
const ( // ListOrderUnordered signifies that list is not ordered. This is the default. ListOrderUnordered ListOrderType = 0 // ListOrderOrdered signifies that list is Ordered. ListOrderOrdered ListOrderType = 1 )
Map storage order.
type ListPolicy ¶
type ListPolicy struct {
// contains filtered or unexported fields
}
ListPolicy directives when creating a list and writing list items.
func DefaultListPolicy ¶
func DefaultListPolicy() *ListPolicy
DefaultListPolicy returns the default policy for CDT list operations.
func NewListPolicy ¶
func NewListPolicy(order ListOrderType, flags int) *ListPolicy
NewListPolicy creates a policy with directives when creating a list and writing list items.
type ListReturnType ¶
type ListReturnType int
ListReturnType determines the returned values in CDT List operations.
const ( // ListReturnTypeNone will not return a result. ListReturnTypeNone ListReturnType = 0 // ListReturnTypeIndex will return index offset order. // 0 = first key // N = Nth key // -1 = last key ListReturnTypeIndex ListReturnType = 1 // ListReturnTypeReverseIndex will return reverse index offset order. // 0 = last key // -1 = first key ListReturnTypeReverseIndex ListReturnType = 2 // ListReturnTypeRank will return value order. // 0 = smallest value // N = Nth smallest value // -1 = largest value ListReturnTypeRank ListReturnType = 3 // ListReturnTypeReverseRank will return reserve value order. // 0 = largest value // N = Nth largest value // -1 = smallest value ListReturnTypeReverseRank ListReturnType = 4 // ListReturnTypeCount will return count of items selected. ListReturnTypeCount ListReturnType = 5 // ListReturnTypeValue will return value for single key read and value list for range read. ListReturnTypeValue ListReturnType = 7 // ListReturnTypeInverted will invert meaning of list command and return values. For example: // ListOperation.getByIndexRange(binName, index, count, ListReturnType.INDEX | ListReturnType.INVERTED) // With the INVERTED flag enabled, the items outside of the specified index range will be returned. // The meaning of the list command can also be inverted. For example: // ListOperation.removeByIndexRange(binName, index, count, ListReturnType.INDEX | ListReturnType.INVERTED); // With the INVERTED flag enabled, the items outside of the specified index range will be removed and returned. ListReturnTypeInverted ListReturnType = 0x10000 )
type ListSortFlags ¶
type ListSortFlags int
ListSortFlags detemines sort flags for CDT lists
const ( // ListSortFlagsDefault is the default sort flag for CDT lists, and sort in Ascending order. ListSortFlagsDefault ListSortFlags = 0 // ListSortFlagsDescending will sort the contents of the list in descending order. ListSortFlagsDescending ListSortFlags = 1 // ListSortFlagsDropDuplicates will drop duplicate values in the results of the CDT list operation. ListSortFlagsDropDuplicates ListSortFlags = 2 )
type ListValue ¶
type ListValue []interface{}
ListValue encapsulates any arbitrary array. Supported by Aerospike 3+ servers only.
func NewListValue ¶
func NewListValue(list []interface{}) ListValue
NewListValue generates a ListValue instance.
func (ListValue) EstimateSize ¶
EstimateSize returns the size of the ListValue in wire protocol.
func (ListValue) GetObject ¶
func (vl ListValue) GetObject() interface{}
GetObject returns original value as an interface{}.
type ListerValue ¶
type ListerValue struct {
// contains filtered or unexported fields
}
ListerValue encapsulates any arbitrary array. Supported by Aerospike 3+ servers only.
func NewListerValue ¶
func NewListerValue(list ListIter) *ListerValue
NewListerValue generates a NewListerValue instance.
func (*ListerValue) EstimateSize ¶
func (vl *ListerValue) EstimateSize() (int, error)
EstimateSize returns the size of the ListerValue in wire protocol.
func (*ListerValue) GetObject ¶
func (vl *ListerValue) GetObject() interface{}
GetObject returns original value as an interface{}.
func (*ListerValue) GetType ¶
func (vl *ListerValue) GetType() int
GetType returns wire protocol value type.
func (*ListerValue) String ¶
func (vl *ListerValue) String() string
String implements Stringer interface.
type LongValue ¶
type LongValue int64
LongValue encapsulates an int64 value.
func NewLongValue ¶
NewLongValue generates a LongValue instance.
func (LongValue) EstimateSize ¶
EstimateSize returns the size of the LongValue in wire protocol.
func (LongValue) GetObject ¶
func (vl LongValue) GetObject() interface{}
GetObject returns original value as an interface{}.
type MapIter ¶
MapIter allows to define general maps of your own type to be used in the Go client without the use of reflection. function PackMap should be exactly Like the following (Do not change, just copy/paste and adapt PackXXX methods):
func (cm *CustomMap) PackMap(buf aerospike.BufferEx) (int, error) { size := 0 for k, v := range cm { n, err := PackXXX(buf, k) size += n if err != nil { return size, err } n, err = PackXXX(buf, v) size += n if err != nil { return size, err } } return size, nil }
Example ¶
package main import ( "fmt" "log" "time" as "github.com/aerospike/aerospike-client-go/v4" ) /* myMapStringTime */ var _ as.MapIter = myMapStringTime(map[string]time.Time{}) // your custom list type myMapStringTime map[string]time.Time func (mm myMapStringTime) PackMap(buf as.BufferEx) (int, error) { size := 0 for key, val := range mm { n, err := as.PackString(buf, key) size += n if err != nil { return size, err } n, err = as.PackInt64(buf, val.UnixNano()) size += n if err != nil { return size, err } } return size, nil } func (mm myMapStringTime) Len() int { return len(mm) } func main() { // Setup the client here // client, err := as.NewClient("127.0.0.1", 3000) // if err != nil { // log.Fatal(err) // } now := time.Unix(123123123, 0) var v as.Value = as.NewValue(myMapStringTime(map[string]time.Time{"now": now})) key, err := as.NewKey("test", "test", 1) if err != nil { log.Fatal(err) } err = client.Put(nil, key, as.BinMap{"myBin": v}) if err != nil { log.Fatal(err) } rec, err := client.Get(nil, key) if err != nil { log.Fatal(err) } fmt.Println(rec.Bins["myBin"]) }
Output: map[now:123123123000000000]
type MapPair ¶
type MapPair struct{ Key, Value interface{} }
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
type MapPolicy ¶
type MapPolicy struct {
// contains filtered or unexported fields
}
MapPolicy directives when creating a map and writing map items.
func DefaultMapPolicy ¶
func DefaultMapPolicy() *MapPolicy
DefaultMapPolicy returns the default map policy
func NewMapPolicy ¶
func NewMapPolicy(order mapOrderType, writeMode *mapWriteMode) *MapPolicy
NewMapPolicy creates a MapPolicy with WriteMode. Use with servers before v4.3
func NewMapPolicyWithFlags ¶
NewMapPolicyWithFlags creates a MapPolicy with WriteFlags. Use with servers v4.3+
type MapValue ¶
type MapValue map[interface{}]interface{}
MapValue encapsulates an arbitrary map. Supported by Aerospike 3+ servers only.
func NewMapValue ¶
func NewMapValue(vmap map[interface{}]interface{}) MapValue
NewMapValue generates a MapValue instance.
func (MapValue) EstimateSize ¶
EstimateSize returns the size of the MapValue in wire protocol.
func (MapValue) GetObject ¶
func (vl MapValue) GetObject() interface{}
GetObject returns original value as an interface{}.
type MapperValue ¶
type MapperValue struct {
// contains filtered or unexported fields
}
MapperValue encapsulates an arbitrary map which implements a MapIter interface. Supported by Aerospike 3+ servers only.
func NewMapperValue ¶
func NewMapperValue(vmap MapIter) *MapperValue
NewMapperValue generates a MapperValue instance.
func (*MapperValue) EstimateSize ¶
func (vl *MapperValue) EstimateSize() (int, error)
EstimateSize returns the size of the MapperValue in wire protocol.
func (*MapperValue) GetObject ¶
func (vl *MapperValue) GetObject() interface{}
GetObject returns original value as an interface{}.
func (*MapperValue) GetType ¶
func (vl *MapperValue) GetType() int
GetType returns wire protocol value type.
func (*MapperValue) String ¶
func (vl *MapperValue) String() string
type MultiPolicy ¶
type MultiPolicy struct { BasePolicy // Maximum number of concurrent requests to server nodes at any point in time. // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries // will be made to 8 nodes in parallel. When a query completes, a new query will // be issued until all 16 nodes have been queried. // Default (0) is to issue requests to all server nodes in parallel. MaxConcurrentNodes int // FailOnClusterChange determines scan termination if cluster is in fluctuating state. // Only used for server versions < 4.9. FailOnClusterChange bool // MaxRecords approximates the number of records to return to the client. This number is divided by the // number of nodes involved in the query. The actual number of records returned // may be less than MaxRecords if node record counts are small and unbalanced across // nodes. // // This field is supported on server versions >= 4.9. // // Default: 0 (do not limit record count) MaxRecords int64 // RecordsPerSecond limits returned records per second (rps) rate for each server. // Will not apply rps limit if recordsPerSecond is zero (default). // Currently only applicable to a query without a defined filter. RecordsPerSecond int // Number of records to place in queue before blocking. // Records received from multiple server nodes will be placed in a queue. // A separate goroutine consumes these records in parallel. // If the queue is full, the producer goroutines will block until records are consumed. RecordQueueSize int //= 50 // Indicates if bin data is retrieved. If false, only record digests are retrieved. IncludeBinData bool //= true; }
MultiPolicy contains parameters for policy attributes used in query and scan operations.
func NewMultiPolicy ¶
func NewMultiPolicy() *MultiPolicy
NewMultiPolicy initializes a MultiPolicy instance with default values.
Set MaxRetries for non-aggregation queries with a nil filter on server versions >= 4.9. All other queries are not retried.
The latest servers support retries on individual data partitions. This feature is useful when a cluster is migrating and partition(s) are missed or incomplete on the first query (with nil filter) attempt.
If the first query attempt misses 2 of 4096 partitions, then only those 2 partitions are retried in the next query attempt from the last key digest received for each respective partition. A higher default MaxRetries is used because it's wasteful to invalidate all query results because a single partition was missed.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents an Aerospike Database Server Node
func GetNodeBatchRead ¶
func GetNodeBatchRead(cluster *Cluster, key *Key, replica ReplicaPolicy, replicaSC ReplicaPolicy, sequence int, sequenceSC int) (*Node, error)
GetNodeBatchRead returns a node for batch reads
func (*Node) Close ¶
func (nd *Node) Close()
Close marks node as inactive and closes all of its pooled connections.
func (*Node) GetConnection ¶
func (nd *Node) GetConnection(timeout time.Duration) (conn *Connection, err error)
GetConnection gets a connection to the node. If no pooled connection is available, a new connection will be created, unless ClientPolicy.MaxQueueSize number of connections are already created. This method will retry to retrieve a connection in case the connection pool is empty, until timeout is reached.
func (*Node) InvalidateConnection ¶
func (nd *Node) InvalidateConnection(conn *Connection)
InvalidateConnection closes and discards a connection from the pool.
func (*Node) MigrationInProgress ¶
MigrationInProgress determines if the node is participating in a data migration
func (*Node) PutConnection ¶
func (nd *Node) PutConnection(conn *Connection)
PutConnection puts back a connection to the pool. If connection pool is full, the connection will be closed and discarded.
func (*Node) Refresh ¶
Refresh requests current status from server node, and updates node with the result.
func (*Node) RequestInfo ¶
RequestInfo gets info values by name from the specified database server node.
func (*Node) RequestStats ¶
func (nd *Node) RequestStats(policy *InfoPolicy) (map[string]string, error)
RequestStats returns statistics for the specified node as a map
func (*Node) WaitUntillMigrationIsFinished ¶
WaitUntillMigrationIsFinished will block until migration operations are finished.
func (*Node) WarmUp ¶
WarmUp fills the node's connection pool with connections. This is necessary on startup for high traffic programs. If the count is <= 0, the connection queue will be filled. If the count is more than the size of the pool, the pool will be filled. Note: One connection per node is reserved for tend operations and is not used for transactions.
type NodeError ¶
type NodeError struct {
// contains filtered or unexported fields
}
NodeError is a type to encapsulate the node that the error occurred in.
type NullValue ¶
type NullValue struct{}
NullValue is an empty value.
func (NullValue) EstimateSize ¶
EstimateSize returns the size of the NullValue in wire protocol.
func (NullValue) GetObject ¶
func (vl NullValue) GetObject() interface{}
GetObject returns original value as an interface{}.
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
Operation contains operation definition. This struct is used in client's operate() method.
func BitAddOp ¶
func BitAddOp( policy *BitPolicy, binName string, bitOffset int, bitSize int, value int64, signed bool, action BitOverflowAction, ctx ...*CDTContext, ) *Operation
BitAddOp creates bit "add" operation. Server adds value to byte[] bin starting at bitOffset for bitSize. BitSize must be <= 64. Signed indicates if bits should be treated as a signed number. If add overflows/underflows, BitOverflowAction is used. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 24 bitSize = 16 value = 128 signed = false bin result = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b10000101]
func BitAndOp ¶
func BitAndOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation
BitAndOp creates bit "and" operation. Server performs bitwise "and" on value and byte[] bin at bitOffset for bitSize. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 23 bitSize = 9 value = [0b00111100, 0b10000000] bin result = [0b00000001, 0b01000010, 0b00000010, 0b00000000, 0b00000101]
func BitCountOp ¶
func BitCountOp(binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation
BitCountOp creates bit "count" operation. Server returns integer count of set bits from byte[] bin starting at bitOffset for bitSize. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 20 bitSize = 4 returns 2
func BitGetIntOp ¶
func BitGetIntOp(binName string, bitOffset int, bitSize int, signed bool, ctx ...*CDTContext) *Operation
BitGetIntOp creates bit "get integer" operation. Server returns integer from byte[] bin starting at bitOffset for bitSize. Signed indicates if bits should be treated as a signed number. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 8 bitSize = 16 signed = false returns 16899
func BitGetOp ¶
func BitGetOp(binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation
BitGetOp creates bit "get" operation. Server returns bits from byte[] bin starting at bitOffset for bitSize. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 9 bitSize = 5 returns [0b1000000]
func BitInsertOp ¶
func BitInsertOp(policy *BitPolicy, binName string, byteOffset int, value []byte, ctx ...*CDTContext) *Operation
BitInsertOp creates byte "insert" operation. Server inserts value bytes into byte[] bin at byteOffset. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] byteOffset = 1 value = [0b11111111, 0b11000111] bin result = [0b00000001, 0b11111111, 0b11000111, 0b01000010, 0b00000011, 0b00000100, 0b00000101]
func BitLScanOp ¶
func BitLScanOp(binName string, bitOffset int, bitSize int, value bool, ctx ...*CDTContext) *Operation
BitLScanOp creates bit "left scan" operation. Server returns integer bit offset of the first specified value bit in byte[] bin starting at bitOffset for bitSize. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 24 bitSize = 8 value = true returns 5
func BitLShiftOp ¶
func BitLShiftOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, shift int, ctx ...*CDTContext) *Operation
BitLShiftOp creates bit "left shift" operation. Server shifts left byte[] bin starting at bitOffset for bitSize. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 32 bitSize = 8 shift = 3 bin result = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00101000]
func BitNotOp ¶
func BitNotOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation
BitNotOp creates bit "not" operation. Server negates byte[] bin starting at bitOffset for bitSize. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 25 bitSize = 6 bin result = [0b00000001, 0b01000010, 0b00000011, 0b01111010, 0b00000101]
func BitOrOp ¶
func BitOrOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation
BitOrOp creates bit "or" operation. Server performs bitwise "or" on value and byte[] bin at bitOffset for bitSize. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 17 bitSize = 6 value = [0b10101000] bin result = [0b00000001, 0b01000010, 0b01010111, 0b00000100, 0b00000101]
func BitRScanOp ¶
func BitRScanOp(binName string, bitOffset int, bitSize int, value bool, ctx ...*CDTContext) *Operation
BitRScanOp creates bit "right scan" operation. Server returns integer bit offset of the last specified value bit in byte[] bin starting at bitOffset for bitSize. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 32 bitSize = 8 value = true returns 7
func BitRShiftOp ¶
func BitRShiftOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, shift int, ctx ...*CDTContext) *Operation
BitRShiftOp creates bit "right shift" operation. Server shifts right byte[] bin starting at bitOffset for bitSize. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 0 bitSize = 9 shift = 1 bin result = [0b00000000, 0b11000010, 0b00000011, 0b00000100, 0b00000101]
func BitRemoveOp ¶
func BitRemoveOp(policy *BitPolicy, binName string, byteOffset int, byteSize int, ctx ...*CDTContext) *Operation
BitRemoveOp creates byte "remove" operation. Server removes bytes from byte[] bin at byteOffset for byteSize. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] byteOffset = 2 byteSize = 3 bin result = [0b00000001, 0b01000010]
func BitResizeOp ¶
func BitResizeOp(policy *BitPolicy, binName string, byteSize int, resizeFlags BitResizeFlags, ctx ...*CDTContext) *Operation
BitResizeOp creates byte "resize" operation. Server resizes byte[] to byteSize according to resizeFlags (See BitResizeFlags). Server does not return a value. Example:
bin = [0b00000001, 0b01000010] byteSize = 4 resizeFlags = 0 bin result = [0b00000001, 0b01000010, 0b00000000, 0b00000000]
func BitSetIntOp ¶
func BitSetIntOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value int64, ctx ...*CDTContext) *Operation
BitSetIntOp creates bit "setInt" operation. Server sets value to byte[] bin starting at bitOffset for bitSize. Size must be <= 64. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 1 bitSize = 8 value = 127 bin result = [0b00111111, 0b11000010, 0b00000011, 0b0000100, 0b00000101]
func BitSetOp ¶
func BitSetOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation
BitSetOp creates bit "set" operation. Server sets value on byte[] bin at bitOffset for bitSize. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 13 bitSize = 3 value = [0b11100000] bin result = [0b00000001, 0b01000111, 0b00000011, 0b00000100, 0b00000101]
func BitSubtractOp ¶
func BitSubtractOp( policy *BitPolicy, binName string, bitOffset int, bitSize int, value int64, signed bool, action BitOverflowAction, ctx ...*CDTContext, ) *Operation
BitSubtractOp creates bit "subtract" operation. Server subtracts value from byte[] bin starting at bitOffset for bitSize. BitSize must be <= 64. Signed indicates if bits should be treated as a signed number. If add overflows/underflows, BitOverflowAction is used. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 24 bitSize = 16 value = 128 signed = false bin result = [0b00000001, 0b01000010, 0b00000011, 0b0000011, 0b10000101]
func BitXorOp ¶
func BitXorOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation
BitXorOp creates bit "exclusive or" operation. Server performs bitwise "xor" on value and byte[] bin at bitOffset for bitSize. Server does not return a value. Example:
bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] bitOffset = 17 bitSize = 6 value = [0b10101100] bin result = [0b00000001, 0b01000010, 0b01010101, 0b00000100, 0b00000101]
func GetHeaderOp ¶
func GetHeaderOp() *Operation
GetHeaderOp creates read record header database operation.
func GetOpForBin ¶
GetOpForBin creates read bin database operation.
func HLLAddOp ¶
func HLLAddOp(policy *HLLPolicy, binName string, list []Value, indexBitCount, minHashBitCount int) *Operation
HLLAddOp creates HLL add operation with minhash bits. Server adds values to HLL set. If HLL bin does not exist, use indexBitCount and minHashBitCount to create HLL bin. Server returns number of entries that caused HLL to update a register.
policy write policy, use DefaultHLLPolicy for default binName name of bin list list of values to be added indexBitCount number of index bits. Must be between 4 and 16 inclusive. Pass -1 for default. minHashBitCount number of min hash bits. Must be between 4 and 58 inclusive. Pass -1 for default.
func HLLDescribeOp ¶
HLLDescribeOp creates HLL describe operation. Server returns indexBitCount and minHashBitCount used to create HLL bin in a list of longs. The list size is 2.
binName name of bin
func HLLFoldOp ¶
HLLFoldOp creates HLL fold operation. Servers folds indexBitCount to the specified value. This can only be applied when minHashBitCount on the HLL bin is 0. Server does not return a value.
binName name of bin indexBitCount number of index bits. Must be between 4 and 16 inclusive.
func HLLGetCountOp ¶
HLLGetCountOp creates HLL getCount operation. Server returns estimated number of elements in the HLL bin.
binName name of bin
func HLLGetIntersectCountOp ¶
HLLGetIntersectCountOp creates HLL getIntersectCount operation. Server returns estimated number of elements that would be contained by the intersection of these HLL objects.
binName name of bin list list of HLL objects
func HLLGetSimilarityOp ¶
HLLGetSimilarityOp creates HLL getSimilarity operation. Server returns estimated similarity of these HLL objects. Return type is a double.
binName name of bin list list of HLL objects
func HLLGetUnionCountOp ¶
HLLGetUnionCountOp creates HLL getUnionCount operation. Server returns estimated number of elements that would be contained by the union of these HLL objects.
binName name of bin list list of HLL objects
func HLLGetUnionOp ¶
HLLGetUnionOp creates HLL getUnion operation. Server returns an HLL object that is the union of all specified HLL objects in the list with the HLL bin.
binName name of bin list list of HLL objects
func HLLInitOp ¶
HLLInitOp creates HLL init operation with minhash bits. Server creates a new HLL or resets an existing HLL. Server does not return a value.
policy write policy, use DefaultHLLPolicy for default binName name of bin indexBitCount number of index bits. Must be between 4 and 16 inclusive. Pass -1 for default. minHashBitCount number of min hash bits. Must be between 4 and 58 inclusive. Pass -1 for default.
func HLLRefreshCountOp ¶
HLLRefreshCountOp creates HLL refresh operation. Server updates the cached count (if stale) and returns the count.
binName name of bin
func HLLSetUnionOp ¶
HLLSetUnionOp creates HLL set union operation. Server sets union of specified HLL objects with HLL bin. Server does not return a value.
policy write policy, use DefaultHLLPolicy for default binName name of bin list list of HLL objects
func ListAppendOp ¶
ListAppendOp creates a list append operation. Server appends values to end of list bin. Server returns list size on bin name. It will panic is no values have been passed.
func ListAppendWithPolicyContextOp ¶
func ListAppendWithPolicyContextOp(policy *ListPolicy, binName string, ctx []*CDTContext, values ...interface{}) *Operation
ListAppendWithPolicyContextOp creates a list append operation. Server appends values to end of list bin. Server returns list size on bin name. It will panic is no values have been passed.
func ListAppendWithPolicyOp ¶
func ListAppendWithPolicyOp(policy *ListPolicy, binName string, values ...interface{}) *Operation
ListAppendWithPolicyOp creates a list append operation. Server appends values to end of list bin. Server returns list size on bin name. It will panic is no values have been passed.
func ListClearOp ¶
func ListClearOp(binName string, ctx ...*CDTContext) *Operation
ListClearOp creates a list clear operation. Server removes all items in list bin. Server does not return a result by default.
func ListCreateOp ¶
func ListCreateOp(binName string, listOrder ListOrderType, pad bool, ctx ...*CDTContext) *Operation
ListCreateOp creates list create operation. Server creates list at given context level. The context is allowed to be beyond list boundaries only if pad is set to true. In that case, nil list entries will be inserted to satisfy the context position.
func ListGetByIndexOp ¶
func ListGetByIndexOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByIndexOp creates list get by index operation. Server selects list item identified by index and returns selected data specified by returnType
func ListGetByIndexRangeCountOp ¶
func ListGetByIndexRangeCountOp(binName string, index, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByIndexRangeCountOp creates list get by index range operation. Server selects "count" list items starting at specified index and returns selected data specified by returnType.
func ListGetByIndexRangeOp ¶
func ListGetByIndexRangeOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByIndexRangeOp creates list get by index range operation. Server selects list items starting at specified index to the end of list and returns selected data specified by returnType.
func ListGetByRankOp ¶
func ListGetByRankOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByRankOp creates a list get by rank operation. Server selects list item identified by rank and returns selected data specified by returnType.
func ListGetByRankRangeCountOp ¶
func ListGetByRankRangeCountOp(binName string, rank, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByRankRangeCountOp creates a list get by rank range operation. Server selects "count" list items starting at specified rank and returns selected data specified by returnType.
func ListGetByRankRangeOp ¶
func ListGetByRankRangeOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByRankRangeOp creates a list get by rank range operation. Server selects list items starting at specified rank to the last ranked item and returns selected data specified by returnType.
func ListGetByValueListOp ¶
func ListGetByValueListOp(binName string, values []interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByValueListOp creates list get by value list operation. Server selects list items identified by values and returns selected data specified by returnType.
func ListGetByValueOp ¶
func ListGetByValueOp(binName string, value interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByValueOp creates a list get by value operation. Server selects list items identified by value and returns selected data specified by returnType.
func ListGetByValueRangeOp ¶
func ListGetByValueRangeOp(binName string, beginValue, endValue interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByValueRangeOp creates a list get by value range operation. Server selects list items identified by value range (valueBegin inclusive, valueEnd exclusive) If valueBegin is null, the range is less than valueEnd. If valueEnd is null, the range is greater than equal to valueBegin. Server returns selected data specified by returnType.
func ListGetByValueRelativeRankRangeCountOp ¶
func ListGetByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByValueRelativeRankRangeCountOp creates a list get by value relative to rank range operation. Server selects list items nearest to value and greater by relative rank with a count limit. Server returns selected data specified by returnType.
Examples for ordered list [0,4,5,9,11,15]:
(value,rank,count) = [selected items] (5,0,2) = [5,9] (5,1,1) = [9] (5,-1,2) = [4,5] (3,0,1) = [4] (3,3,7) = [11,15] (3,-3,2) = []
func ListGetByValueRelativeRankRangeOp ¶
func ListGetByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListGetByValueRelativeRankRangeOp creates a list get by value relative to rank range operation. Server selects list items nearest to value and greater by relative rank. Server returns selected data specified by returnType.
Examples for ordered list [0,4,5,9,11,15]:
(value,rank) = [selected items] (5,0) = [5,9,11,15] (5,1) = [9,11,15] (5,-1) = [4,5,9,11,15] (3,0) = [4,5,9,11,15] (3,3) = [11,15] (3,-3) = [0,4,5,9,11,15]
func ListGetOp ¶
func ListGetOp(binName string, index int, ctx ...*CDTContext) *Operation
ListGetOp creates a list get operation. Server returns item at specified index in list bin.
func ListGetRangeFromOp ¶
func ListGetRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation
ListGetRangeFromOp creates a list get range operation. Server returns items starting at specified index to the end of list.
func ListGetRangeOp ¶
func ListGetRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation
ListGetRangeOp creates a list get range operation. Server returns "count" items starting at specified index in list bin.
func ListIncrementByOneOp ¶
func ListIncrementByOneOp(binName string, index int, ctx ...*CDTContext) *Operation
ListIncrementByOneOp creates list increment operation with policy. Server increments list[index] by 1. Server returns list[index] after incrementing.
func ListIncrementByOneWithPolicyOp ¶
func ListIncrementByOneWithPolicyOp(policy *ListPolicy, binName string, index int, ctx ...*CDTContext) *Operation
ListIncrementByOneWithPolicyOp creates list increment operation with policy. Server increments list[index] by 1. Server returns list[index] after incrementing.
func ListIncrementOp ¶
func ListIncrementOp(binName string, index int, value interface{}, ctx ...*CDTContext) *Operation
ListIncrementOp creates a list increment operation. Server increments list[index] by value. Value should be integer(IntegerValue, LongValue) or float(FloatValue). Server returns list[index] after incrementing.
func ListIncrementWithPolicyOp ¶
func ListIncrementWithPolicyOp(policy *ListPolicy, binName string, index int, value interface{}, ctx ...*CDTContext) *Operation
ListIncrementWithPolicyOp creates a list increment operation. Server increments list[index] by value. Server returns list[index] after incrementing.
func ListInsertOp ¶
ListInsertOp creates a list insert operation. Server inserts value to specified index of list bin. Server returns list size on bin name. It will panic is no values have been passed.
func ListInsertWithPolicyContextOp ¶
func ListInsertWithPolicyContextOp(policy *ListPolicy, binName string, index int, ctx []*CDTContext, values ...interface{}) *Operation
ListInsertWithPolicyContextOp creates a list insert operation. Server inserts value to specified index of list bin. Server returns list size on bin name. It will panic is no values have been passed.
func ListInsertWithPolicyOp ¶
func ListInsertWithPolicyOp(policy *ListPolicy, binName string, index int, values ...interface{}) *Operation
ListInsertWithPolicyOp creates a list insert operation. Server inserts value to specified index of list bin. Server returns list size on bin name. It will panic is no values have been passed.
func ListPopOp ¶
func ListPopOp(binName string, index int, ctx ...*CDTContext) *Operation
ListPopOp creates list pop operation. Server returns item at specified index and removes item from list bin.
func ListPopRangeFromOp ¶
func ListPopRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation
ListPopRangeFromOp creates a list pop range operation. Server returns items starting at specified index to the end of list and removes items from list bin.
func ListPopRangeOp ¶
func ListPopRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation
ListPopRangeOp creates a list pop range operation. Server returns items starting at specified index and removes items from list bin.
func ListRemoveByIndexOp ¶
func ListRemoveByIndexOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListRemoveByIndexOp creates a list remove operation. Server removes list item identified by index and returns removed data specified by returnType.
func ListRemoveByIndexRangeCountOp ¶
func ListRemoveByIndexRangeCountOp(binName string, index, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListRemoveByIndexRangeCountOp creates a list remove operation. Server removes "count" list items starting at specified index and returns removed data specified by returnType.
func ListRemoveByIndexRangeOp ¶
func ListRemoveByIndexRangeOp(binName string, index, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListRemoveByIndexRangeOp creates a list remove operation. Server removes list items starting at specified index to the end of list and returns removed data specified by returnType.
func ListRemoveByRankOp ¶
func ListRemoveByRankOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListRemoveByRankOp creates a list remove operation. Server removes list item identified by rank and returns removed data specified by returnType.
func ListRemoveByRankRangeCountOp ¶
func ListRemoveByRankRangeCountOp(binName string, rank int, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListRemoveByRankRangeCountOp creates a list remove operation. Server removes "count" list items starting at specified rank and returns removed data specified by returnType.
func ListRemoveByRankRangeOp ¶
func ListRemoveByRankRangeOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListRemoveByRankRangeOp creates a list remove operation. Server removes list items starting at specified rank to the last ranked item and returns removed data specified by returnType.
func ListRemoveByValueListOp ¶
func ListRemoveByValueListOp(binName string, values []interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListRemoveByValueListOp creates list remove by value operation. Server removes list items identified by value and returns removed data specified by returnType.
func ListRemoveByValueOp ¶
func ListRemoveByValueOp(binName string, value interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation
ListRemoveByValueOp creates list remove by value operation. Server removes the item identified by value and returns removed data specified by returnType.
func ListRemoveByValueRangeOp ¶
func ListRemoveByValueRangeOp(binName string, returnType ListReturnType, valueBegin, valueEnd interface{}, ctx ...*CDTContext) *Operation
ListRemoveByValueRangeOp creates a list remove operation. Server removes list items identified by value range (valueBegin inclusive, valueEnd exclusive). If valueBegin is nil, the range is less than valueEnd. If valueEnd is nil, the range is greater than equal to valueBegin. Server returns removed data specified by returnType
func ListRemoveByValueRelativeRankRangeCountOp ¶
func ListRemoveByValueRelativeRankRangeCountOp(binName string, returnType ListReturnType, value interface{}, rank, count int, ctx ...*CDTContext) *Operation
ListRemoveByValueRelativeRankRangeCountOp creates a list remove by value relative to rank range operation. Server removes list items nearest to value and greater by relative rank with a count limit. Server returns removed data specified by returnType. Examples for ordered list [0,4,5,9,11,15]:
(value,rank,count) = [removed items] (5,0,2) = [5,9] (5,1,1) = [9] (5,-1,2) = [4,5] (3,0,1) = [4] (3,3,7) = [11,15] (3,-3,2) = []
func ListRemoveByValueRelativeRankRangeOp ¶
func ListRemoveByValueRelativeRankRangeOp(binName string, returnType ListReturnType, value interface{}, rank int, ctx ...*CDTContext) *Operation
ListRemoveByValueRelativeRankRangeOp creates a list remove by value relative to rank range operation. Server removes list items nearest to value and greater by relative rank. Server returns removed data specified by returnType.
Examples for ordered list [0,4,5,9,11,15]:
(value,rank) = [removed items] (5,0) = [5,9,11,15] (5,1) = [9,11,15] (5,-1) = [4,5,9,11,15] (3,0) = [4,5,9,11,15] (3,3) = [11,15] (3,-3) = [0,4,5,9,11,15]
func ListRemoveOp ¶
func ListRemoveOp(binName string, index int, ctx ...*CDTContext) *Operation
ListRemoveOp creates a list remove operation. Server removes item at specified index from list bin. Server returns number of items removed.
func ListRemoveRangeFromOp ¶
func ListRemoveRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation
ListRemoveRangeFromOp creates a list remove range operation. Server removes all items starting at specified index to the end of list. Server returns number of items removed.
func ListRemoveRangeOp ¶
func ListRemoveRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation
ListRemoveRangeOp creates a list remove range operation. Server removes "count" items starting at specified index from list bin. Server returns number of items removed.
func ListSetOp ¶
func ListSetOp(binName string, index int, value interface{}, ctx ...*CDTContext) *Operation
ListSetOp creates a list set operation. Server sets item value at specified index in list bin. Server does not return a result by default.
func ListSetOrderOp ¶
func ListSetOrderOp(binName string, listOrder ListOrderType, ctx ...*CDTContext) *Operation
ListSetOrderOp creates a set list order operation. Server sets list order. Server returns null.
func ListSizeOp ¶
func ListSizeOp(binName string, ctx ...*CDTContext) *Operation
ListSizeOp creates a list size operation. Server returns size of list on bin name.
func ListSortOp ¶
func ListSortOp(binName string, sortFlags ListSortFlags, ctx ...*CDTContext) *Operation
ListSortOp creates list sort operation. Server sorts list according to sortFlags. Server does not return a result by default.
func ListTrimOp ¶
func ListTrimOp(binName string, index int, count int, ctx ...*CDTContext) *Operation
ListTrimOp creates a list trim operation. Server removes items in list bin that do not fall into range specified by index and count range. If the range is out of bounds, then all items will be removed. Server returns number of elemts that were removed.
func MapClearOp ¶
func MapClearOp(binName string, ctx ...*CDTContext) *Operation
MapClearOp creates map clear operation. Server removes all items in map. Server returns null.
func MapCreateOp ¶
func MapCreateOp(binName string, order mapOrderType, ctx []*CDTContext) *Operation
MapCreateOp creates a map create operation. Server creates map at given context level.
func MapDecrementOp ¶
func MapDecrementOp(policy *MapPolicy, binName string, key interface{}, decr interface{}, ctx ...*CDTContext) *Operation
MapDecrementOp creates map decrement operation. Server decrements values by decr for all items identified by key and returns final result. Valid only for numbers.
The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map.
func MapGetByIndexOp ¶
func MapGetByIndexOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByIndexOp creates map get by index operation. Server selects map item identified by index and returns selected data specified by returnType.
func MapGetByIndexRangeCountOp ¶
func MapGetByIndexRangeCountOp(binName string, index int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByIndexRangeCountOp creates map get by index range operation. Server selects "count" map items starting at specified index and returns selected data specified by returnType.
func MapGetByIndexRangeOp ¶
func MapGetByIndexRangeOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByIndexRangeOp creates map get by index range operation. Server selects map items starting at specified index to the end of map and returns selected data specified by returnType.
func MapGetByKeyListOp ¶
func MapGetByKeyListOp(binName string, keys []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByKeyListOp creates a map get by key list operation. Server selects map items identified by keys and returns selected data specified by returnType.
func MapGetByKeyOp ¶
func MapGetByKeyOp(binName string, key interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByKeyOp creates map get by key operation. Server selects map item identified by key and returns selected data specified by returnType.
func MapGetByKeyRangeOp ¶
func MapGetByKeyRangeOp(binName string, keyBegin interface{}, keyEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByKeyRangeOp creates map get by key range operation. Server selects map items identified by key range (keyBegin inclusive, keyEnd exclusive). If keyBegin is null, the range is less than keyEnd. If keyEnd is null, the range is greater than equal to keyBegin.
Server returns selected data specified by returnType.
func MapGetByKeyRelativeIndexRangeCountOp ¶
func MapGetByKeyRelativeIndexRangeCountOp(binName string, key interface{}, index, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByKeyRelativeIndexRangeCountOp creates a map get by key relative to index range operation. Server selects map items nearest to key and greater by index with a count limit. Server returns selected data specified by returnType (See MapReturnType).
Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
(value,index,count) = [selected items] (5,0,1) = [{5=15}] (5,1,2) = [{9=10}] (5,-1,1) = [{4=2}] (3,2,1) = [{9=10}] (3,-2,2) = [{0=17}]
func MapGetByKeyRelativeIndexRangeOp ¶
func MapGetByKeyRelativeIndexRangeOp(binName string, key interface{}, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByKeyRelativeIndexRangeOp creates a map get by key relative to index range operation. Server selects map items nearest to key and greater by index. Server returns selected data specified by returnType.
Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
(value,index) = [selected items] (5,0) = [{5=15},{9=10}] (5,1) = [{9=10}] (5,-1) = [{4=2},{5=15},{9=10}] (3,2) = [{9=10}] (3,-2) = [{0=17},{4=2},{5=15},{9=10}]
func MapGetByRankOp ¶
func MapGetByRankOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByRankOp creates map get by rank operation. Server selects map item identified by rank and returns selected data specified by returnType.
func MapGetByRankRangeCountOp ¶
func MapGetByRankRangeCountOp(binName string, rank int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByRankRangeCountOp creates map get by rank range operation. Server selects "count" map items starting at specified rank and returns selected data specified by returnType.
func MapGetByRankRangeOp ¶
func MapGetByRankRangeOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByRankRangeOp creates map get by rank range operation. Server selects map items starting at specified rank to the last ranked item and returns selected data specified by returnType.
func MapGetByValueListOp ¶
func MapGetByValueListOp(binName string, values []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByValueListOp creates map get by value list operation. Server selects map items identified by values and returns selected data specified by returnType.
func MapGetByValueOp ¶
func MapGetByValueOp(binName string, value interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByValueOp creates map get by value operation. Server selects map items identified by value and returns selected data specified by returnType.
func MapGetByValueRangeOp ¶
func MapGetByValueRangeOp(binName string, valueBegin interface{}, valueEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByValueRangeOp creates map get by value range operation. Server selects map items identified by value range (valueBegin inclusive, valueEnd exclusive) If valueBegin is null, the range is less than valueEnd. If valueEnd is null, the range is greater than equal to valueBegin.
Server returns selected data specified by returnType.
func MapGetByValueRelativeRankRangeCountOp ¶
func MapGetByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByValueRelativeRankRangeCountOp creates a map get by value relative to rank range operation. Server selects map items nearest to value and greater by relative rank with a count limit. Server returns selected data specified by returnType.
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
(value,rank,count) = [selected items] (11,1,1) = [{0=17}] (11,-1,1) = [{9=10}]
func MapGetByValueRelativeRankRangeOp ¶
func MapGetByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapGetByValueRelativeRankRangeOp creates a map get by value relative to rank range operation. Server selects map items nearest to value and greater by relative rank. Server returns selected data specified by returnType.
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
(value,rank) = [selected items] (11,1) = [{0=17}] (11,-1) = [{9=10},{5=15},{0=17}]
func MapIncrementOp ¶
func MapIncrementOp(policy *MapPolicy, binName string, key interface{}, incr interface{}, ctx ...*CDTContext) *Operation
MapIncrementOp creates map increment operation. Server increments values by incr for all items identified by key and returns final result. Valid only for numbers.
The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map.
func MapPutItemsOp ¶
func MapPutItemsOp(policy *MapPolicy, binName string, amap map[interface{}]interface{}, ctx ...*CDTContext) *Operation
MapPutItemsOp creates map put items operation Server writes each map item to map bin and returns map size.
The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map.
func MapPutOp ¶
func MapPutOp(policy *MapPolicy, binName string, key interface{}, value interface{}, ctx ...*CDTContext) *Operation
MapPutOp creates map put operation. Server writes key/value item to map bin and returns map size.
The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map.
func MapRemoveByIndexOp ¶
func MapRemoveByIndexOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByIndexOp creates map remove operation. Server removes map item identified by index and returns removed data specified by returnType.
func MapRemoveByIndexRangeCountOp ¶
func MapRemoveByIndexRangeCountOp(binName string, index int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByIndexRangeCountOp creates map remove operation. Server removes "count" map items starting at specified index and returns removed data specified by returnType.
func MapRemoveByIndexRangeOp ¶
func MapRemoveByIndexRangeOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByIndexRangeOp creates map remove operation. Server removes map items starting at specified index to the end of map and returns removed data specified by returnType.
func MapRemoveByKeyListOp ¶
func MapRemoveByKeyListOp(binName string, keys []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByKeyListOp creates map remove operation. Server removes map items identified by keys and returns removed data specified by returnType.
func MapRemoveByKeyOp ¶
func MapRemoveByKeyOp(binName string, key interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByKeyOp creates map remove operation. Server removes map item identified by key and returns removed data specified by returnType.
func MapRemoveByKeyRangeOp ¶
func MapRemoveByKeyRangeOp(binName string, keyBegin interface{}, keyEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByKeyRangeOp creates map remove operation. Server removes map items identified by key range (keyBegin inclusive, keyEnd exclusive). If keyBegin is null, the range is less than keyEnd. If keyEnd is null, the range is greater than equal to keyBegin.
Server returns removed data specified by returnType.
func MapRemoveByKeyRelativeIndexRangeCountOp ¶
func MapRemoveByKeyRelativeIndexRangeCountOp(binName string, key interface{}, index, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByKeyRelativeIndexRangeCountOp creates map remove by key relative to index range operation. Server removes map items nearest to key and greater by index with a count limit. Server returns removed data specified by returnType.
Examples for map [{0=17},{4=2},{5=15},{9=10}]:
(value,index,count) = [removed items] (5,0,1) = [{5=15}] (5,1,2) = [{9=10}] (5,-1,1) = [{4=2}] (3,2,1) = [{9=10}] (3,-2,2) = [{0=17}]
func MapRemoveByKeyRelativeIndexRangeOp ¶
func MapRemoveByKeyRelativeIndexRangeOp(binName string, key interface{}, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByKeyRelativeIndexRangeOp creates a map remove by key relative to index range operation. Server removes map items nearest to key and greater by index. Server returns removed data specified by returnType.
Examples for map [{0=17},{4=2},{5=15},{9=10}]:
(value,index) = [removed items] (5,0) = [{5=15},{9=10}] (5,1) = [{9=10}] (5,-1) = [{4=2},{5=15},{9=10}] (3,2) = [{9=10}] (3,-2) = [{0=17},{4=2},{5=15},{9=10}]
func MapRemoveByRankOp ¶
func MapRemoveByRankOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByRankOp creates map remove operation. Server removes map item identified by rank and returns removed data specified by returnType.
func MapRemoveByRankRangeCountOp ¶
func MapRemoveByRankRangeCountOp(binName string, rank int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByRankRangeCountOp creates map remove operation. Server removes "count" map items starting at specified rank and returns removed data specified by returnType.
func MapRemoveByRankRangeOp ¶
func MapRemoveByRankRangeOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByRankRangeOp creates map remove operation. Server removes map items starting at specified rank to the last ranked item and returns removed data specified by returnType.
func MapRemoveByValueListOp ¶
func MapRemoveByValueListOp(binName string, values []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByValueListOp creates map remove operation. Server removes map items identified by values and returns removed data specified by returnType.
func MapRemoveByValueOp ¶
func MapRemoveByValueOp(binName string, value interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByValueOp creates map remove operation. Server removes map items identified by value and returns removed data specified by returnType.
func MapRemoveByValueRangeOp ¶
func MapRemoveByValueRangeOp(binName string, valueBegin interface{}, valueEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByValueRangeOp creates map remove operation. Server removes map items identified by value range (valueBegin inclusive, valueEnd exclusive). If valueBegin is null, the range is less than valueEnd. If valueEnd is null, the range is greater than equal to valueBegin.
Server returns removed data specified by returnType.
func MapRemoveByValueRelativeRankRangeCountOp ¶
func MapRemoveByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByValueRelativeRankRangeCountOp creates a map remove by value relative to rank range operation. Server removes map items nearest to value and greater by relative rank with a count limit. Server returns removed data specified by returnType (See MapReturnType).
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
(value,rank,count) = [removed items] (11,1,1) = [{0=17}] (11,-1,1) = [{9=10}]
func MapRemoveByValueRelativeRankRangeOp ¶
func MapRemoveByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation
MapRemoveByValueRelativeRankRangeOp creates a map remove by value relative to rank range operation. Server removes map items nearest to value and greater by relative rank. Server returns removed data specified by returnType.
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
(value,rank) = [removed items] (11,1) = [{0=17}] (11,-1) = [{9=10},{5=15},{0=17}]
func MapSetPolicyOp ¶
func MapSetPolicyOp(policy *MapPolicy, binName string, ctx ...*CDTContext) *Operation
MapSetPolicyOp creates set map policy operation. Server sets map policy attributes. Server returns null.
The required map policy attributes can be changed after the map is created.
func MapSizeOp ¶
func MapSizeOp(binName string, ctx ...*CDTContext) *Operation
MapSizeOp creates map size operation. Server returns size of map.
type OperationType ¶
type OperationType *struct {
// contains filtered or unexported fields
}
OperationType determines operation type
type Partition ¶
type Partition struct { // Namespace of the partition Namespace string // PartitionId of the partition PartitionId int // contains filtered or unexported fields }
Partition encapsulates partition information.
func NewPartition ¶
func NewPartition(partitions *Partitions, key *Key, replica ReplicaPolicy, linearize bool) *Partition
NewPartition returns a partition representation
func PartitionForRead ¶
func PartitionForRead(cluster *Cluster, policy *BasePolicy, key *Key) (*Partition, error)
PartitionForRead returns a partition for read purposes
func PartitionForWrite ¶
func PartitionForWrite(cluster *Cluster, policy *BasePolicy, key *Key) (*Partition, error)
PartitionForWrite returns a partition for write purposes
func (*Partition) GetNodeRead ¶
GetNodeRead returns a node for read operations
func (*Partition) GetNodeWrite ¶
GetNodeWrite returns a node for write operations
func (*Partition) PrepareRetryRead ¶
PrepareRetryRead increases sequence number before read retries
func (*Partition) PrepareRetryWrite ¶
PrepareRetryWrite increases sequence number before write retries
type PartitionFilter ¶
type PartitionFilter struct {
// contains filtered or unexported fields
}
PartitionFilter is used in scan/queries.
func NewPartitionFilterAll ¶
func NewPartitionFilterAll() *PartitionFilter
NewPartitionFilterAll creates a partition filter that reads all the partitions.
func NewPartitionFilterById ¶
func NewPartitionFilterById(partitionId int) *PartitionFilter
NewPartitionFilterById creates a partition filter by partition id. Partition id is between 0 - 4095
func NewPartitionFilterByKey ¶
func NewPartitionFilterByKey(key *Key) *PartitionFilter
NewPartitionFilterByKey creates a partition filter that will return records after key's digest in the partition containing the digest.
func NewPartitionFilterByRange ¶
func NewPartitionFilterByRange(begin, count int) *PartitionFilter
NewPartitionFilterByRange creates a partition filter by partition range. begin partition id is between 0 - 4095 count is the number of partitions, in the range of 1 - 4096 inclusive.
func (*PartitionFilter) IsDone ¶
func (pf *PartitionFilter) IsDone() bool
IsDone returns - if using ScanPolicy.MaxRecords or QueryPolicy,MaxRecords - if the previous paginated scans with this partition filter instance return all records?
type Partitions ¶
Partitions represents a list of partitions
type Policy ¶
type Policy interface { // Retrieves BasePolicy GetBasePolicy() *BasePolicy // contains filtered or unexported methods }
Policy Interface
type PredExp ¶
type PredExp interface { String() string // contains filtered or unexported methods }
PredExp represents a predicate expression
func NewPredExpAnd ¶
NewPredExpAnd creates an AND predicate. Argument describes the number of expressions.
func NewPredExpGeoJSONBin ¶
NewPredExpGeoJSONBin creates a Bin predicate expression which its type is GeoJSON.
func NewPredExpGeoJSONContains ¶
func NewPredExpGeoJSONContains() PredExp
NewPredExpGeoJSONContains creates Region Contains predicate for GeoJSON values
func NewPredExpGeoJSONValue ¶
NewPredExpGeoJSONValue embeds a GeoJSON value in a predicate expression.
func NewPredExpGeoJSONVar ¶
NewPredExpGeoJSONVar creates GeoJSON variable used in list/map iterations.
func NewPredExpGeoJSONWithin ¶
func NewPredExpGeoJSONWithin() PredExp
NewPredExpGeoJSONWithin creates Within Region predicate for GeoJSON values
func NewPredExpIntegerBin ¶
NewPredExpIntegerBin creates a Bin predicate expression which its type is integer.
func NewPredExpIntegerEqual ¶
func NewPredExpIntegerEqual() PredExp
NewPredExpIntegerEqual creates Equal predicate for integer values
func NewPredExpIntegerGreater ¶
func NewPredExpIntegerGreater() PredExp
NewPredExpIntegerGreater creates Greater Than predicate for integer values
func NewPredExpIntegerGreaterEq ¶
func NewPredExpIntegerGreaterEq() PredExp
NewPredExpIntegerGreaterEq creates Greater Than Or Equal predicate for integer values
func NewPredExpIntegerLess ¶
func NewPredExpIntegerLess() PredExp
NewPredExpIntegerLess creates Less Than predicate for integer values
func NewPredExpIntegerLessEq ¶
func NewPredExpIntegerLessEq() PredExp
NewPredExpIntegerLessEq creates Less Than Or Equal predicate for integer values
func NewPredExpIntegerUnequal ¶
func NewPredExpIntegerUnequal() PredExp
NewPredExpIntegerUnequal creates NotEqual predicate for integer values
func NewPredExpIntegerValue ¶
NewPredExpIntegerValue embeds an int64 value in a predicate expression.
func NewPredExpIntegerVar ¶
NewPredExpIntegerVar creates 64 bit integer variable used in list/map iterations.
func NewPredExpListBin ¶
NewPredExpListBin creates a Bin predicate expression which its type is List.
func NewPredExpListIterateAnd ¶
NewPredExpListIterateAnd creates an And iterator predicate for list items
func NewPredExpListIterateOr ¶
NewPredExpListIterateOr creates an Or iterator predicate for list items
func NewPredExpMapBin ¶
NewPredExpMapBin creates a Bin predicate expression which its type is Map.
func NewPredExpMapKeyIterateAnd ¶
NewPredExpMapKeyIterateAnd creates an And iterator predicate on map keys
func NewPredExpMapKeyIterateOr ¶
NewPredExpMapKeyIterateOr creates an Or iterator predicate on map keys
func NewPredExpMapValIterateAnd ¶
NewPredExpMapValIterateAnd creates an And iterator predicate on map values
func NewPredExpMapValIterateOr ¶
NewPredExpMapValIterateOr creates an Or iterator predicate on map values
func NewPredExpOr ¶
NewPredExpOr creates an OR predicate. Argument describes the number of expressions.
func NewPredExpRecDeviceSize ¶
func NewPredExpRecDeviceSize() PredExp
NewPredExpRecDeviceSize creates record size on disk predicate
func NewPredExpRecDigestModulo ¶
NewPredExpRecDigestModulo creates a digest modulo record metadata value predicate expression. The digest modulo expression assumes the value of 4 bytes of the record's key digest modulo as its argument. This predicate is available in Aerospike server versions 3.12.1+
For example, the following sequence of predicate expressions selects records that have digest(key) % 3 == 1):
stmt.SetPredExp( NewPredExpRecDigestModulo(3), NewPredExpIntegerValue(1), NewPredExpIntegerEqual(), )
func NewPredExpRecLastUpdate ¶
func NewPredExpRecLastUpdate() PredExp
NewPredExpRecLastUpdate creates record last update predicate
func NewPredExpRecVoidTime ¶
func NewPredExpRecVoidTime() PredExp
NewPredExpRecVoidTime creates record expiration time predicate expressed in nanoseconds since 1970-01-01 epoch as 64 bit integer.
func NewPredExpStringBin ¶
NewPredExpStringBin creates a Bin predicate expression which its type is String.
func NewPredExpStringEqual ¶
func NewPredExpStringEqual() PredExp
NewPredExpStringEqual creates Equal predicate for string values
func NewPredExpStringRegex ¶
NewPredExpStringRegex creates a Regex predicate
func NewPredExpStringUnequal ¶
func NewPredExpStringUnequal() PredExp
NewPredExpStringUnequal creates Not Equal predicate for string values
func NewPredExpStringValue ¶
NewPredExpStringValue embeds a string value in a predicate expression.
func NewPredExpStringVar ¶
NewPredExpStringVar creates string variable used in list/map iterations.
func NewPredExpUnknownBin ¶
NewPredExpUnknownBin creates a Bin predicate expression which its type is not known.
type Priority ¶
type Priority int
Priority of operations on database server. Currently, this only affects Scan operations. This type is obsolete and will eventually be removed. Only used for server versions < 4.9.
const ( // DEFAULT determines that the server defines the priority. DEFAULT Priority = iota // LOW determines that the server should run the operation in a background thread. LOW // MEDIUM determines that the server should run the operation at medium priority. MEDIUM // HIGH determines that the server should run the operation at the highest priority. HIGH )
type Privilege ¶
type Privilege struct { // Role Code privilegeCode // Namespace determines namespace scope. Apply permission to this namespace only. // If namespace is zero value, the privilege applies to all namespaces. Namespace string // Set name scope. Apply permission to this set within namespace only. // If set is zero value, the privilege applies to all sets within namespace. SetName string }
Privilege determines user access granularity.
type QueryPolicy ¶
type QueryPolicy struct {
MultiPolicy
}
QueryPolicy encapsulates parameters for policy attributes used in query operations.
func NewQueryPolicy ¶
func NewQueryPolicy() *QueryPolicy
NewQueryPolicy generates a new QueryPolicy instance with default values. Set MaxRetries for non-aggregation queries with a nil filter on server versions >= 4.9. All other queries are not retried.
The latest servers support retries on individual data partitions. This feature is useful when a cluster is migrating and partition(s) are missed or incomplete on the first query (with nil filter) attempt.
If the first query attempt misses 2 of 4096 partitions, then only those 2 partitions are retried in the next query attempt from the last key digest received for each respective partition. A higher default MaxRetries is used because it's wasteful to invalidate all query results because a single partition was missed.
type ReadModeAP ¶
type ReadModeAP int
ReadModeAP is the read policy in AP (availability) mode namespaces. It indicates how duplicates should be consulted in a read operation. Only makes a difference during migrations and only applicable in AP mode.
const ( // ReadModeAPOne indicates that a single node should be involved in the read operation. ReadModeAPOne ReadModeAP = iota // ReadModeAPAll indicates that all duplicates should be consulted in // the read operation. ReadModeAPAll )
type ReadModeSC ¶
type ReadModeSC int
ReadModeSC is the read policy in SC (strong consistency) mode namespaces. Determines SC read consistency options.
const ( // ReadModeSCSession ensures this client will only see an increasing sequence of record versions. // Server only reads from master. This is the default. ReadModeSCSession ReadModeSC = iota // ReadModeSCLinearize ensures ALL clients will only see an increasing sequence of record versions. // Server only reads from master. ReadModeSCLinearize // ReadModeSCAllowReplica indicates that the server may read from master or any full (non-migrating) replica. // Increasing sequence of record versions is not guaranteed. ReadModeSCAllowReplica // partitions. Increasing sequence of record versions is not guaranteed. ReadModeSCAllowUnavailable )
type Record ¶
type Record struct { // Key is the record's key. // Might be empty, or may only consist of digest value. Key *Key // Node from which the Record is originating from. Node *Node // Bins is the map of requested name/value bins. Bins BinMap // Generation shows record modification count. Generation uint32 // Expiration is TTL (Time-To-Live). // Number of seconds until record expires. Expiration uint32 }
Record is the container struct for database records. Records are equivalent to rows.
type RecordExistsAction ¶
type RecordExistsAction int
RecordExistsAction determines how to handle writes when the record already exists.
const ( // UPDATE means: Create or update record. // Merge write command bins with existing bins. UPDATE RecordExistsAction = iota // UPDATE_ONLY means: Update record only. Fail if record does not exist. // Merge write command bins with existing bins. UPDATE_ONLY // REPLACE means: Create or replace record. // Delete existing bins not referenced by write command bins. // Supported by Aerospike 2 server versions >= 2.7.5 and // Aerospike 3 server versions >= 3.1.6 and later. REPLACE // REPLACE_ONLY means: Replace record only. Fail if record does not exist. // Delete existing bins not referenced by write command bins. // Supported by Aerospike 2 server versions >= 2.7.5 and // Aerospike 3 server versions >= 3.1.6 and later. REPLACE_ONLY // CREATE_ONLY means: Create only. Fail if record exists. CREATE_ONLY )
type Recordset ¶
type Recordset struct { // Records is a channel on which the resulting records will be sent back. // NOTE: Do not use Records directly. Range on channel returned by Results() instead. // Will be unexported in the future Records chan *Record // contains filtered or unexported fields }
Recordset encapsulates the result of Scan and Query commands.
func (*Recordset) Close ¶
Close all streams from different nodes. A successful close return nil, subsequent calls to the method will return ErrRecordsetClosed.
func (*Recordset) IsActive ¶
IsActive returns true if the operation hasn't been finished or cancelled.
func (*Recordset) Read ¶
Read reads the next record from the Recordset. If the Recordset has been closed, it returns ErrRecordsetClosed.
func (*Recordset) Results ¶
Results returns a new receive-only channel with the results of the Scan/Query. This is a more idiomatic approach to the iterator pattern in getting the results back from the recordset, and doesn't require the user to write the ugly select in their code. Result contains a Record and an error reference.
Example:
recordset, err := client.ScanAll(nil, namespace, set) handleError(err) for res := range recordset.Results() { if res.Err != nil { // handle error here } else { // process record here fmt.Println(res.Record.Bins) } }
type RegisterTask ¶
type RegisterTask struct {
// contains filtered or unexported fields
}
RegisterTask is used to poll for UDF registration completion.
func NewRegisterTask ¶
func NewRegisterTask(cluster *Cluster, packageName string) *RegisterTask
NewRegisterTask initializes a RegisterTask with fields needed to query server nodes.
func (*RegisterTask) IsDone ¶
func (tskr *RegisterTask) IsDone() (bool, error)
IsDone will query all nodes for task completion status.
func (*RegisterTask) OnComplete ¶
func (tskr *RegisterTask) OnComplete() chan error
OnComplete returns a channel that will be closed as soon as the task is finished. If an error is encountered during operation, an error will be sent on the channel.
type RemoveTask ¶
type RemoveTask struct {
// contains filtered or unexported fields
}
RemoveTask is used to poll for UDF registration completion.
func NewRemoveTask ¶
func NewRemoveTask(cluster *Cluster, packageName string) *RemoveTask
NewRemoveTask initializes a RemoveTask with fields needed to query server nodes.
func (*RemoveTask) IsDone ¶
func (tskr *RemoveTask) IsDone() (bool, error)
IsDone will query all nodes for task completion status.
func (*RemoveTask) OnComplete ¶
func (tskr *RemoveTask) OnComplete() chan error
OnComplete returns a channel that will be closed as soon as the task is finished. If an error is encountered during operation, an error will be sent on the channel.
type ReplicaPolicy ¶
type ReplicaPolicy int
ReplicaPolicy defines type of node partition targeted by read commands.
const ( // MASTER reads from node containing key's master partition. // This is the default behavior. MASTER ReplicaPolicy = iota // MASTER_PROLES Distributes reads across nodes containing key's master and replicated partitions // in round-robin fashion. MASTER_PROLES // RANDOM Distribute reads across all nodes in cluster in round-robin fashion. // This option is useful when the replication factor equals the number // of nodes in the cluster and the overhead of requesting proles is not desired. RANDOM // SEQUENCE Tries node containing master partition first. // If connection fails, all commands try nodes containing replicated partitions. // If socketTimeout is reached, reads also try nodes containing replicated partitions, // but writes remain on master node. SEQUENCE // PREFER_RACK Tries nodes on the same rack first. // // This option requires ClientPolicy.Rackaware to be enabled // in order to function properly. PREFER_RACK )
func GetReplicaPolicySC ¶
func GetReplicaPolicySC(policy *BasePolicy) ReplicaPolicy
GetReplicaPolicySC returns a ReplicaPolicy based on different variables in SC mode
type ScanPolicy ¶
type ScanPolicy struct { MultiPolicy // ScanPercent determines percent of data to scan. // Valid integer range is 1 to 100. // // This field is supported on server versions < 4.9. // For server versions >= 4.9, use MultiPolicy.MaxRecords. // // Default is 100. ScanPercent int //= 100; // ConcurrentNodes determines how to issue scan requests (in parallel or sequentially). // The value of MultiPolicy.MaxConcurrentNodes will determine how many nodes will be // called in parallel. // This value is deprected and will be removed in the future. ConcurrentNodes bool //= true; }
ScanPolicy encapsulates parameters used in scan operations.
func NewScanPolicy ¶
func NewScanPolicy() *ScanPolicy
NewScanPolicy creates a new ScanPolicy instance with default values. Set MaxRetries for scans on server versions >= 4.9. All other scans are not retried.
The latest servers support retries on individual data partitions. This feature is useful when a cluster is migrating and partition(s) are missed or incomplete on the first scan attempt.
If the first scan attempt misses 2 of 4096 partitions, then only those 2 partitions are retried in the next scan attempt from the last key digest received for each respective partition. A higher default MaxRetries is used because it's wasteful to invalidate all scan results because a single partition was missed.
type Statement ¶
type Statement struct { // Namespace determines query Namespace Namespace string // SetName determines query Set name (Optional) SetName string // IndexName determines query index name (Optional) // If not set, the server will determine the index from the filter's bin name. IndexName string // BinNames detemines bin names (optional) BinNames []string // Filter determines query index filter (Optional). // This filter is applied to the secondary index on query. // Query index filters must reference a bin which has a secondary index defined. Filter *Filter // TaskId determines query task id. (Optional) // This value is not used anymore and will be removed later. TaskId uint64 // contains filtered or unexported fields }
Statement encapsulates query statement parameters.
func NewStatement ¶
NewStatement initializes a new Statement instance.
func (*Statement) IsScan ¶
IsScan determines is the Statement is a full namespace/set scan or a selective Query.
func (*Statement) SetAggregateFunction ¶
func (stmt *Statement) SetAggregateFunction(packageName string, functionName string, functionArgs []Value, returnData bool)
SetAggregateFunction sets aggregation function parameters. This function will be called on both the server and client for each selected item.
func (*Statement) SetFilter ¶
SetFilter Sets a filter for the statement. Aerospike Server currently only supports using a single filter per statement/query.
func (*Statement) SetPredExp ¶
SetPredExp sets low-level predicate expressions for the statement in postfix notation. Supported only by Aerospike Server v3.12+. Predicate expression filters are applied on the query results on the server. Predicate expression filters may occur on any bin in the record. To learn how to use this API, consult predexp_test.go file.
Postfix notation is described here: http://wiki.c2.com/?PostfixNotation
Example: (c >= 11 and c <= 20) or (d > 3 and (d < 5)
stmt.SetPredExp( NewPredExpIntegerValue(11), NewPredExpIntegerBin("c"), NewPredExpIntegerGreaterEq(), NewPredExpIntegerValue(20), NewPredExpIntegerBin("c"), NewPredExpIntegerLessEq(), NewPredExpAnd(2), NewPredExpIntegerValue(3), NewPredExpIntegerBin("d"), NewPredExpIntegerGreater(), NewPredExpIntegerValue(5), NewPredExpIntegerBin("d"), NewPredExpIntegerLess(), NewPredExpAnd(2), NewPredExpOr(2) ); // Record last update time > 2017-01-15 stmt.SetPredExp( NewIntegerValue(time.Date(2017, 0, 15, 0, 0, 0, 0, time.UTC).UnixNano()), NewPredExpRecLastUpdate(), NewPredExpIntegerGreater(), );
NOTE: This feature is deprecated on Aerospike servers and will be removed in the future. It has been replaced by FilterExpressions.
type StringValue ¶
type StringValue string
StringValue encapsulates a string value.
func NewStringValue ¶
func NewStringValue(value string) StringValue
NewStringValue generates a StringValue instance.
func (StringValue) EstimateSize ¶
func (vl StringValue) EstimateSize() (int, error)
EstimateSize returns the size of the StringValue in wire protocol.
func (StringValue) GetObject ¶
func (vl StringValue) GetObject() interface{}
GetObject returns original value as an interface{}.
func (StringValue) GetType ¶
func (vl StringValue) GetType() int
GetType returns wire protocol value type.
func (StringValue) String ¶
func (vl StringValue) String() string
String implements Stringer interface.
type Task ¶
type Task interface { IsDone() (bool, error) OnComplete() chan error // contains filtered or unexported methods }
Task interface defines methods for asynchronous tasks.
type UDF ¶
type UDF struct { // Filename of the UDF Filename string // Hash digest of the UDF Hash string // Language of UDF Language Language }
UDF carries information about UDFs on the server
type UserRoles ¶
type UserRoles struct { // User name. User string // Roles is a list of assigned roles. Roles []string }
UserRoles contains information about a user.
type Value ¶
type Value interface { // Calculate number of vl.bytes necessary to serialize the value in the wire protocol. EstimateSize() (int, error) // GetType returns wire protocol value type. GetType() int // GetObject returns original value as an interface{}. GetObject() interface{} // String implements Stringer interface. String() string // contains filtered or unexported methods }
Value interface is used to efficiently serialize objects into the wire protocol.
func NewValue ¶
func NewValue(v interface{}) Value
NewValue generates a new Value object based on the type. If the type is not supported, NewValue will panic. This method is a convenience method, and should not be used when absolute performance is required unless for the reason mentioned below.
If you have custom maps or slices like:
type MyMap map[primitive1]primitive2, eg: map[int]string
or
type MySlice []primitive, eg: []float64
cast them to their primitive type when passing them to this method:
v := NewValue(map[int]string(myVar)) v := NewValue([]float64(myVar))
This way you will avoid hitting reflection. To completely avoid reflection in the library, use the build tag: as_performance while building your program.
type ValueArray ¶
type ValueArray []Value
ValueArray encapsulates an array of Value. Supported by Aerospike 3+ servers only.
func NewValueArray ¶
func NewValueArray(array []Value) *ValueArray
NewValueArray generates a ValueArray instance.
func (ValueArray) EstimateSize ¶
func (va ValueArray) EstimateSize() (int, error)
EstimateSize returns the size of the ValueArray in wire protocol.
func (ValueArray) GetObject ¶
func (va ValueArray) GetObject() interface{}
GetObject returns original value as an interface{}.
func (ValueArray) GetType ¶
func (va ValueArray) GetType() int
GetType returns wire protocol value type.
func (ValueArray) String ¶
func (va ValueArray) String() string
String implements Stringer interface.
type WildCardValue ¶
type WildCardValue struct{}
WildCardValue is an empty value.
func NewWildCardValue ¶
func NewWildCardValue() WildCardValue
NewWildCardValue generates a WildCardValue instance.
func (WildCardValue) EstimateSize ¶
func (vl WildCardValue) EstimateSize() (int, error)
EstimateSize returns the size of the WildCardValue in wire protocol.
func (WildCardValue) GetObject ¶
func (vl WildCardValue) GetObject() interface{}
GetObject returns original value as an interface{}.
func (WildCardValue) GetType ¶
func (vl WildCardValue) GetType() int
GetType returns wire protocol value type.
func (WildCardValue) String ¶
func (vl WildCardValue) String() string
type WritePolicy ¶
type WritePolicy struct { BasePolicy // RecordExistsAction qualifies how to handle writes where the record already exists. RecordExistsAction RecordExistsAction //= RecordExistsAction.UPDATE; // GenerationPolicy qualifies how to handle record writes based on record generation. The default (NONE) // indicates that the generation is not used to restrict writes. GenerationPolicy GenerationPolicy //= GenerationPolicy.NONE; // Desired consistency guarantee when committing a transaction on the server. The default // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to // be successful before returning success to the client. CommitLevel CommitLevel //= COMMIT_ALL // Generation determines expected generation. // Generation is the number of times a record has been // modified (including creation) on the server. // If a write operation is creating a record, the expected generation would be 0. Generation uint32 // Expiration determines record expiration in seconds. Also known as TTL (Time-To-Live). // Seconds record will live before being removed by the server. // Expiration values: // TTLServerDefault (0): Default to namespace configuration variable "default-ttl" on the server. // TTLDontExpire (MaxUint32): Never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server // TTLDontUpdate (MaxUint32 - 1): Do not change ttl when record is written. Supported by Aerospike server versions >= 3.10.1 // > 0: Actual expiration in seconds. Expiration uint32 // RespondPerEachOp defines for client.Operate() method, return a result for every operation. // Some list operations do not return results by default (ListClearOp() for example). // This can sometimes make it difficult to determine the desired result offset in the returned // bin's result list. // // Setting RespondPerEachOp to true makes it easier to identify the desired result offset // (result offset equals bin's operate sequence). This only makes sense when multiple list // operations are used in one operate call and some of those operations do not return results // by default. RespondPerEachOp bool // DurableDelete leaves a tombstone for the record if the transaction results in a record deletion. // This prevents deleted records from reappearing after node failures. // Valid for Aerospike Server Enterprise Edition 3.10+ only. DurableDelete bool }
WritePolicy encapsulates parameters for policy attributes used in write operations. This object is passed into methods where database writes can occur.
func NewWritePolicy ¶
func NewWritePolicy(generation, expiration uint32) *WritePolicy
NewWritePolicy initializes a new WritePolicy instance with default parameters.
Source Files ¶
- admin_command.go
- admin_policy.go
- aerospike.go
- auth_mode.go
- batch_command.go
- batch_command_exists.go
- batch_command_get.go
- batch_command_get_reflect.go
- batch_command_reflect.go
- batch_index_command_get.go
- batch_node.go
- batch_policy.go
- batch_read.go
- bin.go
- bit_overflow_action.go
- bit_policy.go
- bit_resize_flags.go
- bit_write_flags.go
- buffered_connection.go
- bytes_buffer.go
- cdt.go
- cdt_bitwise.go
- cdt_context.go
- cdt_list.go
- cdt_map.go
- client.go
- client_appengine_exclusions.go
- client_policy.go
- client_reflect.go
- cluster.go
- command.go
- commit_policy.go
- compat_after_go1.8.go
- connection.go
- connection_heap.go
- delete_command.go
- execute_command.go
- execute_task.go
- exists_command.go
- exp_bit.go
- exp_hll.go
- exp_list.go
- exp_map.go
- expression.go
- field_type.go
- filter.go
- generation_policy.go
- generics.go
- hll_operation.go
- hll_policy.go
- hll_write_flags.go
- host.go
- index_collection_type.go
- index_type.go
- info.go
- info_policy.go
- key.go
- key_helper.go
- language.go
- login_command.go
- marshal.go
- multi_command.go
- multi_policy.go
- node.go
- node_error.go
- node_stats.go
- node_validator.go
- operate_command.go
- operation.go
- packer.go
- packer_reflect.go
- partition.go
- partition_filter.go
- partition_parser.go
- partition_status.go
- partition_tracker.go
- partitions.go
- peers.go
- peers_parser.go
- policy.go
- predexp.go
- priority.go
- privilege.go
- query_aggregate_command.go
- query_command.go
- query_executor.go
- query_objects_command.go
- query_objects_executor.go
- query_partition_command.go
- query_partitiopn_objects_command.go
- query_policy.go
- query_record_command.go
- query_validate.go
- read_command.go
- read_command_reflect.go
- read_header_command.go
- read_mode_ap.go
- read_mode_sc.go
- record.go
- record_exists_action.go
- recordset.go
- replica_policy.go
- role.go
- scan_command.go
- scan_executor.go
- scan_objects_command.go
- scan_objects_executor.go
- scan_partition_command.go
- scan_partition_objects_command.go
- scan_policy.go
- server_command.go
- single_command.go
- statement.go
- task.go
- task_drop_index.go
- task_index.go
- task_register.go
- task_remove.go
- touch_command.go
- udf.go
- unpacker.go
- user_roles.go
- value.go
- value_helpers.go
- value_reflect.go
- write_command.go
- write_policy.go