Documentation ¶
Overview ¶
Package riak provides the interfaces needed to interact with Riak KV using Protocol Buffers. Riak KV is a distributed key-value datastore designed to be fault tolerant, scalable, and flexible.
Currently, this library was written for and tested against Riak KV 2.0+.
TL;DR;
import ( "fmt" "os" riak "github.com/basho/riak-go-client" ) func main() { nodeOpts := &riak.NodeOptions{ RemoteAddress: "127.0.0.1:8087", } var node *riak.Node var err error if node, err = riak.NewNode(nodeOpts); err != nil { fmt.Println(err.Error()) os.Exit(1) } nodes := []*riak.Node{node} opts := &riak.ClusterOptions{ Nodes: nodes, } cluster, err := riak.NewCluster(opts) if err != nil { fmt.Println(err.Error()) os.Exit(1) } defer func() { if err := cluster.Stop(); err != nil { fmt.Println(err.Error()) os.Exit(1) } }() if err := cluster.Start(); err != nil { fmt.Println(err.Error()) os.Exit(1) } obj := &riak.Object{ ContentType: "text/plain", Charset: "utf-8", ContentEncoding: "utf-8", Value: []byte("this is a value in Riak"), } cmd, err := riak.NewStoreValueCommandBuilder(). WithBucket("testBucketName"). WithContent(obj). Build() if err != nil { fmt.Println(err.Error()) os.Exit(1) } if err := cluster.Execute(cmd); err != nil { fmt.Println(err.Error()) os.Exit(1) } svc := cmd.(*riak.StoreValueCommand) rsp := svc.Response fmt.Println(rsp.GeneratedKey) }
Index ¶
- Constants
- Variables
- func ToUnixMillis(t time.Time) int64
- type Async
- type AuthOptions
- type Client
- type ClientError
- type Cluster
- type ClusterOptions
- type Command
- type CommandBuilder
- type CommitHook
- type ConflictResolver
- type DeleteIndexCommand
- type DeleteIndexCommandBuilder
- type DeleteValueCommand
- type DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) Build() (Command, error)
- func (builder *DeleteValueCommandBuilder) WithBucket(bucket string) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithBucketType(bucketType string) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithDw(dw uint32) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithKey(key string) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithPr(pr uint32) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithPw(pw uint32) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithR(r uint32) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithRw(rw uint32) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithTimeout(timeout time.Duration) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithVClock(vclock []byte) *DeleteValueCommandBuilder
- func (builder *DeleteValueCommandBuilder) WithW(w uint32) *DeleteValueCommandBuilder
- type FetchBucketPropsCommand
- type FetchBucketPropsCommandBuilder
- type FetchBucketPropsResponse
- type FetchBucketTypePropsCommand
- type FetchBucketTypePropsCommandBuilder
- type FetchCounterCommand
- type FetchCounterCommandBuilder
- func (builder *FetchCounterCommandBuilder) Build() (Command, error)
- func (builder *FetchCounterCommandBuilder) WithBasicQuorum(basicQuorum bool) *FetchCounterCommandBuilder
- func (builder *FetchCounterCommandBuilder) WithBucket(bucket string) *FetchCounterCommandBuilder
- func (builder *FetchCounterCommandBuilder) WithBucketType(bucketType string) *FetchCounterCommandBuilder
- func (builder *FetchCounterCommandBuilder) WithKey(key string) *FetchCounterCommandBuilder
- func (builder *FetchCounterCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchCounterCommandBuilder
- func (builder *FetchCounterCommandBuilder) WithPr(pr uint32) *FetchCounterCommandBuilder
- func (builder *FetchCounterCommandBuilder) WithR(r uint32) *FetchCounterCommandBuilder
- func (builder *FetchCounterCommandBuilder) WithTimeout(timeout time.Duration) *FetchCounterCommandBuilder
- type FetchCounterResponse
- type FetchIndexCommand
- type FetchIndexCommandBuilder
- type FetchMapCommand
- type FetchMapCommandBuilder
- func (builder *FetchMapCommandBuilder) Build() (Command, error)
- func (builder *FetchMapCommandBuilder) WithBasicQuorum(basicQuorum bool) *FetchMapCommandBuilder
- func (builder *FetchMapCommandBuilder) WithBucket(bucket string) *FetchMapCommandBuilder
- func (builder *FetchMapCommandBuilder) WithBucketType(bucketType string) *FetchMapCommandBuilder
- func (builder *FetchMapCommandBuilder) WithKey(key string) *FetchMapCommandBuilder
- func (builder *FetchMapCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchMapCommandBuilder
- func (builder *FetchMapCommandBuilder) WithPr(pr uint32) *FetchMapCommandBuilder
- func (builder *FetchMapCommandBuilder) WithR(r uint32) *FetchMapCommandBuilder
- func (builder *FetchMapCommandBuilder) WithTimeout(timeout time.Duration) *FetchMapCommandBuilder
- type FetchMapResponse
- type FetchPreflistCommand
- type FetchPreflistCommandBuilder
- func (builder *FetchPreflistCommandBuilder) Build() (Command, error)
- func (builder *FetchPreflistCommandBuilder) WithBucket(bucket string) *FetchPreflistCommandBuilder
- func (builder *FetchPreflistCommandBuilder) WithBucketType(bucketType string) *FetchPreflistCommandBuilder
- func (builder *FetchPreflistCommandBuilder) WithKey(key string) *FetchPreflistCommandBuilder
- type FetchPreflistResponse
- type FetchSchemaCommand
- type FetchSchemaCommandBuilder
- type FetchSetCommand
- type FetchSetCommandBuilder
- func (builder *FetchSetCommandBuilder) Build() (Command, error)
- func (builder *FetchSetCommandBuilder) WithBasicQuorum(basicQuorum bool) *FetchSetCommandBuilder
- func (builder *FetchSetCommandBuilder) WithBucket(bucket string) *FetchSetCommandBuilder
- func (builder *FetchSetCommandBuilder) WithBucketType(bucketType string) *FetchSetCommandBuilder
- func (builder *FetchSetCommandBuilder) WithKey(key string) *FetchSetCommandBuilder
- func (builder *FetchSetCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchSetCommandBuilder
- func (builder *FetchSetCommandBuilder) WithPr(pr uint32) *FetchSetCommandBuilder
- func (builder *FetchSetCommandBuilder) WithR(r uint32) *FetchSetCommandBuilder
- func (builder *FetchSetCommandBuilder) WithTimeout(timeout time.Duration) *FetchSetCommandBuilder
- type FetchSetResponse
- type FetchValueCommand
- type FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) Build() (Command, error)
- func (builder *FetchValueCommandBuilder) WithBasicQuorum(basicQuorum bool) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithBucket(bucket string) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithBucketType(bucketType string) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithConflictResolver(resolver ConflictResolver) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithHeadOnly(headOnly bool) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithIfModified(ifModified []byte) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithKey(key string) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithNVal(nval uint32) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithPr(pr uint32) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithR(r uint32) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithReturnDeletedVClock(returnDeletedVClock bool) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithSloppyQuorum(sloppyQuorum bool) *FetchValueCommandBuilder
- func (builder *FetchValueCommandBuilder) WithTimeout(timeout time.Duration) *FetchValueCommandBuilder
- type FetchValueResponse
- type GetServerInfoCommand
- type GetServerInfoResponse
- type Link
- type ListBucketsCommand
- type ListBucketsCommandBuilder
- func (builder *ListBucketsCommandBuilder) Build() (Command, error)
- func (builder *ListBucketsCommandBuilder) WithBucketType(bucketType string) *ListBucketsCommandBuilder
- func (builder *ListBucketsCommandBuilder) WithCallback(callback func([]string) error) *ListBucketsCommandBuilder
- func (builder *ListBucketsCommandBuilder) WithStreaming(streaming bool) *ListBucketsCommandBuilder
- func (builder *ListBucketsCommandBuilder) WithTimeout(timeout time.Duration) *ListBucketsCommandBuilder
- type ListBucketsResponse
- type ListKeysCommand
- type ListKeysCommandBuilder
- func (builder *ListKeysCommandBuilder) Build() (Command, error)
- func (builder *ListKeysCommandBuilder) WithBucket(bucket string) *ListKeysCommandBuilder
- func (builder *ListKeysCommandBuilder) WithBucketType(bucketType string) *ListKeysCommandBuilder
- func (builder *ListKeysCommandBuilder) WithCallback(callback func([]string) error) *ListKeysCommandBuilder
- func (builder *ListKeysCommandBuilder) WithStreaming(streaming bool) *ListKeysCommandBuilder
- func (builder *ListKeysCommandBuilder) WithTimeout(timeout time.Duration) *ListKeysCommandBuilder
- type ListKeysResponse
- type Map
- type MapOperation
- func (mapOp *MapOperation) AddToSet(key string, value []byte) *MapOperation
- func (mapOp *MapOperation) IncrementCounter(key string, increment int64) *MapOperation
- func (mapOp *MapOperation) Map(key string) *MapOperation
- func (mapOp *MapOperation) RemoveCounter(key string) *MapOperation
- func (mapOp *MapOperation) RemoveFlag(key string) *MapOperation
- func (mapOp *MapOperation) RemoveFromSet(key string, value []byte) *MapOperation
- func (mapOp *MapOperation) RemoveMap(key string) *MapOperation
- func (mapOp *MapOperation) RemoveRegister(key string) *MapOperation
- func (mapOp *MapOperation) RemoveSet(key string) *MapOperation
- func (mapOp *MapOperation) SetFlag(key string, value bool) *MapOperation
- func (mapOp *MapOperation) SetRegister(key string, value []byte) *MapOperation
- type MapReduceCommand
- type MapReduceCommandBuilder
- func (builder *MapReduceCommandBuilder) Build() (Command, error)
- func (builder *MapReduceCommandBuilder) WithCallback(callback func([]byte) error) *MapReduceCommandBuilder
- func (builder *MapReduceCommandBuilder) WithQuery(query string) *MapReduceCommandBuilder
- func (builder *MapReduceCommandBuilder) WithStreaming(streaming bool) *MapReduceCommandBuilder
- type ModFun
- type NewClientOptions
- type Node
- type NodeManager
- type NodeOptions
- type Object
- type Pair
- type PingCommand
- type PingCommandBuilder
- type PreflistItem
- type ReplMode
- type ResetBucketCommand
- type ResetBucketCommandBuilder
- type RiakError
- type Schema
- type SearchCommand
- type SearchCommandBuilder
- func (builder *SearchCommandBuilder) Build() (Command, error)
- func (builder *SearchCommandBuilder) WithDefaultField(defaultField string) *SearchCommandBuilder
- func (builder *SearchCommandBuilder) WithDefaultOperation(op string) *SearchCommandBuilder
- func (builder *SearchCommandBuilder) WithFilterQuery(filterQuery string) *SearchCommandBuilder
- func (builder *SearchCommandBuilder) WithIndexName(index string) *SearchCommandBuilder
- func (builder *SearchCommandBuilder) WithNumRows(numRows uint32) *SearchCommandBuilder
- func (builder *SearchCommandBuilder) WithPresort(presort string) *SearchCommandBuilder
- func (builder *SearchCommandBuilder) WithQuery(query string) *SearchCommandBuilder
- func (builder *SearchCommandBuilder) WithReturnFields(fields ...string) *SearchCommandBuilder
- func (builder *SearchCommandBuilder) WithSortField(sortField string) *SearchCommandBuilder
- func (builder *SearchCommandBuilder) WithStart(start uint32) *SearchCommandBuilder
- type SearchDoc
- type SearchIndex
- type SearchResponse
- type SecondaryIndexQueryCommand
- type SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) Build() (Command, error)
- func (builder *SecondaryIndexQueryCommandBuilder) WithBucket(bucket string) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithBucketType(bucketType string) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithCallback(callback func([]*SecondaryIndexQueryResult) error) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithContinuation(cont []byte) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithIndexKey(key string) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithIndexName(indexName string) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithIntIndexKey(key int) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithIntRange(min int64, max int64) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithMaxResults(maxResults uint32) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithPaginationSort(paginationSort bool) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithRange(min string, max string) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithReturnKeyAndIndex(val bool) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithStreaming(streaming bool) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithTermRegex(regex string) *SecondaryIndexQueryCommandBuilder
- func (builder *SecondaryIndexQueryCommandBuilder) WithTimeout(timeout time.Duration) *SecondaryIndexQueryCommandBuilder
- type SecondaryIndexQueryResponse
- type SecondaryIndexQueryResult
- type StoreBucketPropsCommand
- type StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) AddPostCommit(commitHook *CommitHook) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) AddPreCommit(commitHook *CommitHook) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) Build() (Command, error)
- func (builder *StoreBucketPropsCommandBuilder) WithAllowMult(allowMult bool) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithBackend(backend string) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithBasicQuorum(basicQuorum bool) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithBigVClock(bigVClock uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithBucket(bucket string) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithBucketType(bucketType string) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithChashKeyFun(val *ModFun) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithDw(dw uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithLastWriteWins(lww bool) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithNVal(nval uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithNotFoundOk(notFoundOk bool) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithOldVClock(oldVClock uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithPr(pr uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithPw(pw uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithR(r uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithRw(rw uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithSearch(search bool) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithSearchIndex(searchIndex string) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithSmallVClock(smallVClock uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithW(w uint32) *StoreBucketPropsCommandBuilder
- func (builder *StoreBucketPropsCommandBuilder) WithYoungVClock(youngVClock uint32) *StoreBucketPropsCommandBuilder
- type StoreBucketTypePropsCommand
- type StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) AddPostCommit(commitHook *CommitHook) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) AddPreCommit(commitHook *CommitHook) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) Build() (Command, error)
- func (builder *StoreBucketTypePropsCommandBuilder) WithAllowMult(allowMult bool) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithBackend(backend string) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithBasicQuorum(basicQuorum bool) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithBigVClock(bigVClock uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithBucketType(bucketType string) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithChashKeyFun(val *ModFun) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithDw(dw uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithLastWriteWins(lww bool) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithNVal(nval uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithNotFoundOk(notFoundOk bool) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithOldVClock(oldVClock uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithPr(pr uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithPw(pw uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithR(r uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithRw(rw uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithSearch(search bool) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithSearchIndex(searchIndex string) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithSmallVClock(smallVClock uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithW(w uint32) *StoreBucketTypePropsCommandBuilder
- func (builder *StoreBucketTypePropsCommandBuilder) WithYoungVClock(youngVClock uint32) *StoreBucketTypePropsCommandBuilder
- type StoreIndexCommand
- type StoreIndexCommandBuilder
- func (builder *StoreIndexCommandBuilder) Build() (Command, error)
- func (builder *StoreIndexCommandBuilder) WithIndexName(indexName string) *StoreIndexCommandBuilder
- func (builder *StoreIndexCommandBuilder) WithNVal(nval uint32) *StoreIndexCommandBuilder
- func (builder *StoreIndexCommandBuilder) WithSchemaName(schemaName string) *StoreIndexCommandBuilder
- func (builder *StoreIndexCommandBuilder) WithTimeout(timeout time.Duration) *StoreIndexCommandBuilder
- type StoreSchemaCommand
- type StoreSchemaCommandBuilder
- type StoreValueCommand
- type StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) Build() (Command, error)
- func (builder *StoreValueCommandBuilder) WithAsis(asis bool) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithBucket(bucket string) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithBucketType(bucketType string) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithConflictResolver(resolver ConflictResolver) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithContent(object *Object) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithDw(dw uint32) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithIfNoneMatch(ifNoneMatch bool) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithIfNotModified(ifNotModified bool) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithKey(key string) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithNVal(nval uint32) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithPw(pw uint32) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithReturnBody(returnBody bool) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithReturnHead(returnHead bool) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithSloppyQuorum(sloppyQuorum bool) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithTimeout(timeout time.Duration) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithVClock(vclock []byte) *StoreValueCommandBuilder
- func (builder *StoreValueCommandBuilder) WithW(w uint32) *StoreValueCommandBuilder
- type StoreValueResponse
- type TsCell
- type TsColumnDescription
- type TsDeleteRowCommand
- type TsDeleteRowCommandBuilder
- func (builder *TsDeleteRowCommandBuilder) Build() (Command, error)
- func (builder *TsDeleteRowCommandBuilder) WithKey(key []TsCell) *TsDeleteRowCommandBuilder
- func (builder *TsDeleteRowCommandBuilder) WithTable(table string) *TsDeleteRowCommandBuilder
- func (builder *TsDeleteRowCommandBuilder) WithTimeout(timeout time.Duration) *TsDeleteRowCommandBuilder
- type TsFetchRowCommand
- type TsFetchRowCommandBuilder
- func (builder *TsFetchRowCommandBuilder) Build() (Command, error)
- func (builder *TsFetchRowCommandBuilder) WithKey(key []TsCell) *TsFetchRowCommandBuilder
- func (builder *TsFetchRowCommandBuilder) WithTable(table string) *TsFetchRowCommandBuilder
- func (builder *TsFetchRowCommandBuilder) WithTimeout(timeout time.Duration) *TsFetchRowCommandBuilder
- type TsFetchRowResponse
- type TsListKeysCommand
- type TsListKeysCommandBuilder
- func (builder *TsListKeysCommandBuilder) Build() (Command, error)
- func (builder *TsListKeysCommandBuilder) WithCallback(callback func([][]TsCell) error) *TsListKeysCommandBuilder
- func (builder *TsListKeysCommandBuilder) WithStreaming(streaming bool) *TsListKeysCommandBuilder
- func (builder *TsListKeysCommandBuilder) WithTable(table string) *TsListKeysCommandBuilder
- func (builder *TsListKeysCommandBuilder) WithTimeout(timeout time.Duration) *TsListKeysCommandBuilder
- type TsListKeysResponse
- type TsQueryCommand
- type TsQueryCommandBuilder
- func (builder *TsQueryCommandBuilder) Build() (Command, error)
- func (builder *TsQueryCommandBuilder) WithCallback(callback func([][]TsCell) error) *TsQueryCommandBuilder
- func (builder *TsQueryCommandBuilder) WithQuery(query string) *TsQueryCommandBuilder
- func (builder *TsQueryCommandBuilder) WithStreaming(streaming bool) *TsQueryCommandBuilder
- type TsQueryResponse
- type TsStoreRowsCommand
- type TsStoreRowsCommandBuilder
- type UpdateCounterCommand
- type UpdateCounterCommandBuilder
- func (builder *UpdateCounterCommandBuilder) Build() (Command, error)
- func (builder *UpdateCounterCommandBuilder) WithBucket(bucket string) *UpdateCounterCommandBuilder
- func (builder *UpdateCounterCommandBuilder) WithBucketType(bucketType string) *UpdateCounterCommandBuilder
- func (builder *UpdateCounterCommandBuilder) WithDw(dw uint32) *UpdateCounterCommandBuilder
- func (builder *UpdateCounterCommandBuilder) WithIncrement(increment int64) *UpdateCounterCommandBuilder
- func (builder *UpdateCounterCommandBuilder) WithKey(key string) *UpdateCounterCommandBuilder
- func (builder *UpdateCounterCommandBuilder) WithPw(pw uint32) *UpdateCounterCommandBuilder
- func (builder *UpdateCounterCommandBuilder) WithReturnBody(returnBody bool) *UpdateCounterCommandBuilder
- func (builder *UpdateCounterCommandBuilder) WithTimeout(timeout time.Duration) *UpdateCounterCommandBuilder
- func (builder *UpdateCounterCommandBuilder) WithW(w uint32) *UpdateCounterCommandBuilder
- type UpdateCounterResponse
- type UpdateMapCommand
- type UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) Build() (Command, error)
- func (builder *UpdateMapCommandBuilder) WithBucket(bucket string) *UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) WithBucketType(bucketType string) *UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) WithContext(context []byte) *UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) WithDw(dw uint32) *UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) WithKey(key string) *UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) WithMapOperation(mapOperation *MapOperation) *UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) WithPw(pw uint32) *UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) WithReturnBody(returnBody bool) *UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) WithTimeout(timeout time.Duration) *UpdateMapCommandBuilder
- func (builder *UpdateMapCommandBuilder) WithW(w uint32) *UpdateMapCommandBuilder
- type UpdateMapResponse
- type UpdateSetCommand
- type UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) Build() (Command, error)
- func (builder *UpdateSetCommandBuilder) WithAdditions(adds ...[]byte) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithBucket(bucket string) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithBucketType(bucketType string) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithContext(context []byte) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithDw(dw uint32) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithKey(key string) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithPw(pw uint32) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithRemovals(removals ...[]byte) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithReturnBody(returnBody bool) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithTimeout(timeout time.Duration) *UpdateSetCommandBuilder
- func (builder *UpdateSetCommandBuilder) WithW(w uint32) *UpdateSetCommandBuilder
- type UpdateSetResponse
Examples ¶
Constants ¶
const ErrClientInvalidRemoteAddress = "[Client] invalid RemoteAddress '%s'"
const ErrClusterNoNodesAvailable = "[Cluster] all retries exhausted and/or no nodes available to execute command"
Variables ¶
var ( ErrClientOptionsRequired = newClientError("[Client] options are required", nil) ErrClientMissingRequiredData = newClientError("[Client] options must specify either a Cluster or a set of RemoteAddresses", nil) )
var ( ErrClusterNodesMustBeNonNil = newClientError("[Cluster] all nodes must be non-nil", nil) ErrClusterCommandRequired = newClientError("[Cluster] Command must be non-nil", nil) ErrClusterAsyncRequiresChannelOrWaitGroup = newClientError("[Cluster] ExecuteAsync argument requires a channel or sync.WaitGroup to indicate completion", nil) ErrClusterEnqueueWhileShuttingDown = newClientError("[Cluster] will not enqueue command, shutting down", nil) ErrClusterShuttingDown = newClientError("[Cluster] will not execute command, shutting down", nil) ErrClusterNodeMustBeNonNil = newClientError("[Cluster] node argument must be non-nil", nil) )
Cluster errors
var ( ErrCannotRead = errors.New("Cannot read from a non-active or closed connection") ErrCannotWrite = errors.New("Cannot write to a non-active or closed connection") )
Connection errors
var ( ErrConnectionManagerRequiresOptions = newClientError("[connectionManager] new manager requires options", nil) ErrConnectionManagerRequiresAddress = newClientError("[connectionManager] new manager requires non-nil address", nil) ErrConnectionManagerMaxMustBeGreaterThanMin = newClientError("[connectionManager] new connection manager maxConnections must be greater than minConnections", nil) ErrConnMgrAllConnectionsInUse = newClientError("[connectionManager] all connections in use / max connections reached", nil) )
var ( ErrAddressRequired = newClientError("RemoteAddress is required in options", nil) ErrAuthMissingConfig = newClientError("[Connection] authentication is missing TLS config", nil) ErrAuthTLSUpgradeFailed = newClientError("[Connection] upgrading to TLS connection failed", nil) ErrBucketRequired = newClientError("Bucket is required", nil) ErrKeyRequired = newClientError("Key is required", nil) ErrNilOptions = newClientError("[Command] options must be non-nil", nil) ErrOptionsRequired = newClientError("Options are required", nil) ErrZeroLength = newClientError("[Command] 0 byte data response", nil) ErrTableRequired = newClientError("Table is required", nil) ErrQueryRequired = newClientError("Query is required", nil) )
Client errors
var EnableDebugLogging = false
If true, debug messages will be written to the log
var ErrDefaultNodeManagerRequiresNode = newClientError("Must pass at least one node to default node manager", nil)
Functions ¶
func ToUnixMillis ¶ added in v1.7.0
ToUnixMillis converts a time.Time to Unix milliseconds since UTC epoch
Types ¶
type Async ¶
type Async struct { Command Command Done chan Command Wait *sync.WaitGroup Error error // contains filtered or unexported fields }
Async object is used to pass required arguments to execute a Command asynchronously
type AuthOptions ¶
AuthOptions object contains the authentication credentials and tls config
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client object contains your cluster object
func NewClient ¶
func NewClient(opts *NewClientOptions) (*Client, error)
NewClient generates a new Client object using the provided options
func (*Client) ExecuteAsync ¶
Execute (asynchronously) the provided Command against the cluster
type ClientError ¶
func (ClientError) Error ¶
func (e ClientError) Error() (s string)
type Cluster ¶
Cluster object contains your pool of Node objects, the NodeManager and the current stateData object of the cluster
func NewCluster ¶
func NewCluster(options *ClusterOptions) (*Cluster, error)
NewCluster generates a new Cluster object using the provided ClusterOptions object
Example ¶
cluster, err := NewCluster(nil) if err != nil { panic(fmt.Sprintf("Error building cluster object: %s", err.Error())) } fmt.Println(cluster.nodes[0].addr.String())
Output: 127.0.0.1:8087
func (*Cluster) Execute ¶
Execute (synchronously) the provided Command against the active pooled Nodes using the NodeManager
func (*Cluster) ExecuteAsync ¶
Execute (asynchronously) the provided Command against the active pooled Nodes using the NodeManager
func (*Cluster) RemoveNode ¶
Stops the node and removes from the cluster
func (*Cluster) Start ¶
Start opens connections with your configured nodes and adds them to the active pool
type ClusterOptions ¶
type ClusterOptions struct { Nodes []*Node NoDefaultNode bool NodeManager NodeManager ExecutionAttempts byte QueueMaxDepth uint16 QueueExecutionInterval time.Duration }
ClusterOptions object contains your pool of Node objects and the NodeManager If the NodeManager is not defined, the defaultNodeManager is used
type Command ¶
type Command interface { Name() string Success() bool Error() error // contains filtered or unexported methods }
Command interface enforces proper structure of a Command object
type CommandBuilder ¶
CommandBuilder interface requires Build() method for generating the Command to be executed
type CommitHook ¶
CommitHook object is used when fetching or updating pre- or post- commit hook bucket properties on Riak
type ConflictResolver ¶
ConflictResolver is an interface to handle sibling conflicts for a key
type DeleteIndexCommand ¶
type DeleteIndexCommand struct { Response bool // contains filtered or unexported fields }
DeleteIndexCommand is used to delete a search index from Riak
func (*DeleteIndexCommand) Name ¶
func (cmd *DeleteIndexCommand) Name() string
Name identifies this command
type DeleteIndexCommandBuilder ¶
type DeleteIndexCommandBuilder struct {
// contains filtered or unexported fields
}
DeleteIndexCommandBuilder type is required for creating new instances of DeleteIndexCommand
command := NewDeleteIndexCommandBuilder(). WithIndexName("myIndexName"). Build()
func NewDeleteIndexCommandBuilder ¶
func NewDeleteIndexCommandBuilder() *DeleteIndexCommandBuilder
NewDeleteIndexCommandBuilder is a factory function for generating the command builder struct
func (*DeleteIndexCommandBuilder) Build ¶
func (builder *DeleteIndexCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*DeleteIndexCommandBuilder) WithIndexName ¶
func (builder *DeleteIndexCommandBuilder) WithIndexName(indexName string) *DeleteIndexCommandBuilder
WithIndexName sets the index to use for the command
type DeleteValueCommand ¶
type DeleteValueCommand struct { Response bool // contains filtered or unexported fields }
DeleteValueCommand is used to delete a value from Riak KV.
func (*DeleteValueCommand) Name ¶
func (cmd *DeleteValueCommand) Name() string
Name identifies this command
type DeleteValueCommandBuilder ¶
type DeleteValueCommandBuilder struct {
// contains filtered or unexported fields
}
DeleteValueCommandBuilder type is required for creating new instances of DeleteValueCommand
deleteValue := NewDeleteValueCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithKey("myKey"). WithVClock(vclock). Build()
func NewDeleteValueCommandBuilder ¶
func NewDeleteValueCommandBuilder() *DeleteValueCommandBuilder
NewDeleteValueCommandBuilder is a factory function for generating the command builder struct
func (*DeleteValueCommandBuilder) Build ¶
func (builder *DeleteValueCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*DeleteValueCommandBuilder) WithBucket ¶
func (builder *DeleteValueCommandBuilder) WithBucket(bucket string) *DeleteValueCommandBuilder
WithBucket sets the bucket to be used by the command
func (*DeleteValueCommandBuilder) WithBucketType ¶
func (builder *DeleteValueCommandBuilder) WithBucketType(bucketType string) *DeleteValueCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*DeleteValueCommandBuilder) WithDw ¶
func (builder *DeleteValueCommandBuilder) WithDw(dw uint32) *DeleteValueCommandBuilder
WithDw (durable writes) sets the number of nodes that must report back a successful write to backend storage in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*DeleteValueCommandBuilder) WithKey ¶
func (builder *DeleteValueCommandBuilder) WithKey(key string) *DeleteValueCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*DeleteValueCommandBuilder) WithPr ¶
func (builder *DeleteValueCommandBuilder) WithPr(pr uint32) *DeleteValueCommandBuilder
WithPr sets the number of primary nodes (N) that must be read from in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*DeleteValueCommandBuilder) WithPw ¶
func (builder *DeleteValueCommandBuilder) WithPw(pw uint32) *DeleteValueCommandBuilder
WithPw sets the number of primary nodes (N) that must report back a successful write in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*DeleteValueCommandBuilder) WithR ¶
func (builder *DeleteValueCommandBuilder) WithR(r uint32) *DeleteValueCommandBuilder
WithR sets the number of nodes that must report back a successful read in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*DeleteValueCommandBuilder) WithRw ¶
func (builder *DeleteValueCommandBuilder) WithRw(rw uint32) *DeleteValueCommandBuilder
WithRw (delete quorum) sets the number of nodes that must report back a successful delete to backend storage in order for the command operation to be considered a success by Riak. It represents the read and write operations that are completed internal to Riak to complete a delete. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*DeleteValueCommandBuilder) WithTimeout ¶
func (builder *DeleteValueCommandBuilder) WithTimeout(timeout time.Duration) *DeleteValueCommandBuilder
WithTimeout sets a timeout to be used for this command operation
func (*DeleteValueCommandBuilder) WithVClock ¶
func (builder *DeleteValueCommandBuilder) WithVClock(vclock []byte) *DeleteValueCommandBuilder
WithVClock sets the vector clock.
If not set siblings may be created depending on bucket properties.
func (*DeleteValueCommandBuilder) WithW ¶
func (builder *DeleteValueCommandBuilder) WithW(w uint32) *DeleteValueCommandBuilder
WithW sets the number of nodes that must report back a successful write in order for then command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
type FetchBucketPropsCommand ¶
type FetchBucketPropsCommand struct { Response *FetchBucketPropsResponse // contains filtered or unexported fields }
FetchBucketPropsCommand is used to fetch the active / non-default properties for a bucket
func (*FetchBucketPropsCommand) Error ¶ added in v1.2.0
func (cmd *FetchBucketPropsCommand) Error() error
func (*FetchBucketPropsCommand) Name ¶
func (cmd *FetchBucketPropsCommand) Name() string
type FetchBucketPropsCommandBuilder ¶
type FetchBucketPropsCommandBuilder struct {
// contains filtered or unexported fields
}
FetchBucketPropsCommandBuilder type is required for creating new instances of FetchBucketPropsCommand
command := NewFetchBucketPropsCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). Build()
func NewFetchBucketPropsCommandBuilder ¶
func NewFetchBucketPropsCommandBuilder() *FetchBucketPropsCommandBuilder
NewFetchBucketPropsCommandBuilder is a factory function for generating the command builder struct
func (*FetchBucketPropsCommandBuilder) Build ¶
func (builder *FetchBucketPropsCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*FetchBucketPropsCommandBuilder) WithBucket ¶
func (builder *FetchBucketPropsCommandBuilder) WithBucket(bucket string) *FetchBucketPropsCommandBuilder
WithBucket sets the bucket to be used by the command
func (*FetchBucketPropsCommandBuilder) WithBucketType ¶
func (builder *FetchBucketPropsCommandBuilder) WithBucketType(bucketType string) *FetchBucketPropsCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
type FetchBucketPropsResponse ¶
type FetchBucketPropsResponse struct { NVal uint32 AllowMult bool LastWriteWins bool HasPrecommit bool HasPostcommit bool OldVClock uint32 YoungVClock uint32 BigVClock uint32 SmallVClock uint32 R uint32 Pr uint32 W uint32 Pw uint32 Dw uint32 Rw uint32 BasicQuorum bool NotFoundOk bool Search bool Consistent bool Repl ReplMode Backend string SearchIndex string DataType string PreCommit []*CommitHook PostCommit []*CommitHook ChashKeyFun *ModFun LinkFun *ModFun }
FetchBucketPropsResponse contains the response data for both FetchBucketPropsCommand and FetchBucketTypePropsCommand
type FetchBucketTypePropsCommand ¶ added in v1.5.0
type FetchBucketTypePropsCommand struct { Response *FetchBucketPropsResponse // contains filtered or unexported fields }
FetchBucketTypePropsCommand is used to fetch the active / non-default properties for a bucket type
func (*FetchBucketTypePropsCommand) Error ¶ added in v1.5.0
func (cmd *FetchBucketTypePropsCommand) Error() error
func (*FetchBucketTypePropsCommand) Name ¶ added in v1.5.0
func (cmd *FetchBucketTypePropsCommand) Name() string
type FetchBucketTypePropsCommandBuilder ¶ added in v1.5.0
type FetchBucketTypePropsCommandBuilder struct {
// contains filtered or unexported fields
}
FetchBucketTypePropsCommandBuilder type is required for creating new instances of FetchBucketTypePropsCommand
command := NewFetchBucketTypePropsCommandBuilder(). WithBucketType("myBucketType"). Build()
func NewFetchBucketTypePropsCommandBuilder ¶ added in v1.5.0
func NewFetchBucketTypePropsCommandBuilder() *FetchBucketTypePropsCommandBuilder
NewFetchBucketTypePropsCommandBuilder is a factory function for generating the command builder struct
func (*FetchBucketTypePropsCommandBuilder) Build ¶ added in v1.5.0
func (builder *FetchBucketTypePropsCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*FetchBucketTypePropsCommandBuilder) WithBucketType ¶ added in v1.5.0
func (builder *FetchBucketTypePropsCommandBuilder) WithBucketType(bucketType string) *FetchBucketTypePropsCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
type FetchCounterCommand ¶
type FetchCounterCommand struct { Response *FetchCounterResponse // contains filtered or unexported fields }
FetchCounterCommand fetches a counter CRDT from Riak
func (*FetchCounterCommand) Name ¶
func (cmd *FetchCounterCommand) Name() string
Name identifies this command
type FetchCounterCommandBuilder ¶
type FetchCounterCommandBuilder struct {
// contains filtered or unexported fields
}
FetchCounterCommandBuilder type is required for creating new instances of FetchCounterCommand
command := NewFetchCounterCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithKey("myKey"). Build()
func NewFetchCounterCommandBuilder ¶
func NewFetchCounterCommandBuilder() *FetchCounterCommandBuilder
NewFetchCounterCommandBuilder is a factory function for generating the command builder struct
func (*FetchCounterCommandBuilder) Build ¶
func (builder *FetchCounterCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*FetchCounterCommandBuilder) WithBasicQuorum ¶
func (builder *FetchCounterCommandBuilder) WithBasicQuorum(basicQuorum bool) *FetchCounterCommandBuilder
WithBasicQuorum sets basic_quorum, whether to return early in some failure cases (eg. when r=1 and you get 2 errors and a success basic_quorum=true would return an error)
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*FetchCounterCommandBuilder) WithBucket ¶
func (builder *FetchCounterCommandBuilder) WithBucket(bucket string) *FetchCounterCommandBuilder
WithBucket sets the bucket to be used by the command
func (*FetchCounterCommandBuilder) WithBucketType ¶
func (builder *FetchCounterCommandBuilder) WithBucketType(bucketType string) *FetchCounterCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*FetchCounterCommandBuilder) WithKey ¶
func (builder *FetchCounterCommandBuilder) WithKey(key string) *FetchCounterCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*FetchCounterCommandBuilder) WithNotFoundOk ¶
func (builder *FetchCounterCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchCounterCommandBuilder
WithNotFoundOk sets notfound_ok, whether to treat notfounds as successful reads for the purposes of R
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*FetchCounterCommandBuilder) WithPr ¶
func (builder *FetchCounterCommandBuilder) WithPr(pr uint32) *FetchCounterCommandBuilder
WithPr sets the number of primary nodes (N) that must be read from in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*FetchCounterCommandBuilder) WithR ¶
func (builder *FetchCounterCommandBuilder) WithR(r uint32) *FetchCounterCommandBuilder
WithR sets the number of nodes that must report back a successful read in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*FetchCounterCommandBuilder) WithTimeout ¶
func (builder *FetchCounterCommandBuilder) WithTimeout(timeout time.Duration) *FetchCounterCommandBuilder
WithTimeout sets a timeout to be used for this command operation
type FetchCounterResponse ¶
FetchCounterResponse contains the response data for a FetchCounterCommand
type FetchIndexCommand ¶
type FetchIndexCommand struct { Response []*SearchIndex // contains filtered or unexported fields }
FetchIndexCommand is used to fetch a search index from Riak
func (*FetchIndexCommand) Name ¶
func (cmd *FetchIndexCommand) Name() string
Name identifies this command
type FetchIndexCommandBuilder ¶
type FetchIndexCommandBuilder struct {
// contains filtered or unexported fields
}
FetchIndexCommandBuilder type is required for creating new instances of FetchIndexCommand
command := NewFetchIndexCommandBuilder(). WithIndexName("myIndexName"). Build()
func NewFetchIndexCommandBuilder ¶
func NewFetchIndexCommandBuilder() *FetchIndexCommandBuilder
NewFetchIndexCommandBuilder is a factory function for generating the command builder struct
func (*FetchIndexCommandBuilder) Build ¶
func (builder *FetchIndexCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*FetchIndexCommandBuilder) WithIndexName ¶
func (builder *FetchIndexCommandBuilder) WithIndexName(indexName string) *FetchIndexCommandBuilder
WithIndexName sets the index to use for the command
type FetchMapCommand ¶
type FetchMapCommand struct { Response *FetchMapResponse // contains filtered or unexported fields }
FetchMapCommand fetches a map CRDT from Riak
func (*FetchMapCommand) Name ¶
func (cmd *FetchMapCommand) Name() string
Name identifies this command
type FetchMapCommandBuilder ¶
type FetchMapCommandBuilder struct {
// contains filtered or unexported fields
}
FetchMapCommandBuilder type is required for creating new instances of FetchMapCommand
command := NewFetchMapCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithKey("myKey"). Build()
func NewFetchMapCommandBuilder ¶
func NewFetchMapCommandBuilder() *FetchMapCommandBuilder
NewFetchMapCommandBuilder is a factory function for generating the command builder struct
func (*FetchMapCommandBuilder) Build ¶
func (builder *FetchMapCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*FetchMapCommandBuilder) WithBasicQuorum ¶
func (builder *FetchMapCommandBuilder) WithBasicQuorum(basicQuorum bool) *FetchMapCommandBuilder
WithBasicQuorum sets basic_quorum, whether to return early in some failure cases (eg. when r=1 and you get 2 errors and a success basic_quorum=true would return an error)
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*FetchMapCommandBuilder) WithBucket ¶
func (builder *FetchMapCommandBuilder) WithBucket(bucket string) *FetchMapCommandBuilder
WithBucket sets the bucket to be used by the command
func (*FetchMapCommandBuilder) WithBucketType ¶
func (builder *FetchMapCommandBuilder) WithBucketType(bucketType string) *FetchMapCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*FetchMapCommandBuilder) WithKey ¶
func (builder *FetchMapCommandBuilder) WithKey(key string) *FetchMapCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*FetchMapCommandBuilder) WithNotFoundOk ¶
func (builder *FetchMapCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchMapCommandBuilder
WithNotFoundOk sets notfound_ok, whether to treat notfounds as successful reads for the purposes of R
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*FetchMapCommandBuilder) WithPr ¶
func (builder *FetchMapCommandBuilder) WithPr(pr uint32) *FetchMapCommandBuilder
WithPr sets the number of primary nodes (N) that must be read from in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*FetchMapCommandBuilder) WithR ¶
func (builder *FetchMapCommandBuilder) WithR(r uint32) *FetchMapCommandBuilder
WithR sets the number of nodes that must report back a successful read in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*FetchMapCommandBuilder) WithTimeout ¶
func (builder *FetchMapCommandBuilder) WithTimeout(timeout time.Duration) *FetchMapCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
type FetchMapResponse ¶
FetchMapResponse contains the response data for a FetchMapCommand
type FetchPreflistCommand ¶
type FetchPreflistCommand struct { Response *FetchPreflistResponse // contains filtered or unexported fields }
FetchPreflistCommand is used to fetch the preference list for a key from Riak KV
func (*FetchPreflistCommand) Name ¶
func (cmd *FetchPreflistCommand) Name() string
Name identifies this command
type FetchPreflistCommandBuilder ¶
type FetchPreflistCommandBuilder struct {
// contains filtered or unexported fields
}
FetchPreflistCommandBuilder type is required for creating new instances of FetchPreflistCommand
preflist := NewFetchPreflistCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithKey("myKey"). Build()
func NewFetchPreflistCommandBuilder ¶
func NewFetchPreflistCommandBuilder() *FetchPreflistCommandBuilder
NewFetchPreflistCommandBuilder is a factory function for generating the command builder struct
func (*FetchPreflistCommandBuilder) Build ¶
func (builder *FetchPreflistCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*FetchPreflistCommandBuilder) WithBucket ¶
func (builder *FetchPreflistCommandBuilder) WithBucket(bucket string) *FetchPreflistCommandBuilder
WithBucket sets the bucket to be used by the command
func (*FetchPreflistCommandBuilder) WithBucketType ¶
func (builder *FetchPreflistCommandBuilder) WithBucketType(bucketType string) *FetchPreflistCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*FetchPreflistCommandBuilder) WithKey ¶
func (builder *FetchPreflistCommandBuilder) WithKey(key string) *FetchPreflistCommandBuilder
WithKey sets the key to be used by the command to read / write values
type FetchPreflistResponse ¶
type FetchPreflistResponse struct {
Preflist []*PreflistItem
}
FetchPreflistResponse contains the response data for a FetchPreflistCommand
type FetchSchemaCommand ¶
type FetchSchemaCommand struct { Response *Schema // contains filtered or unexported fields }
FetchSchemaCommand is used to GET a search schema from Riak
func (*FetchSchemaCommand) Name ¶
func (cmd *FetchSchemaCommand) Name() string
Name identifies this command
type FetchSchemaCommandBuilder ¶
type FetchSchemaCommandBuilder struct {
// contains filtered or unexported fields
}
FetchSchemaCommandBuilder type is required for creating new instances of FetchSchemaCommand
command := NewFetchSchemaCommandBuilder(). WithSchemaName("mySchemaName"). Build()
func NewFetchSchemaCommandBuilder ¶
func NewFetchSchemaCommandBuilder() *FetchSchemaCommandBuilder
NewFetchSchemaCommandBuilder is a factory function for generating the command builder struct
func (*FetchSchemaCommandBuilder) Build ¶
func (builder *FetchSchemaCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*FetchSchemaCommandBuilder) WithSchemaName ¶
func (builder *FetchSchemaCommandBuilder) WithSchemaName(schemaName string) *FetchSchemaCommandBuilder
WithSchemaName sets the schema that the command will use
type FetchSetCommand ¶
type FetchSetCommand struct { Response *FetchSetResponse // contains filtered or unexported fields }
FetchSetCommand fetches a set CRDT from Riak
func (*FetchSetCommand) Name ¶
func (cmd *FetchSetCommand) Name() string
Name identifies this command
type FetchSetCommandBuilder ¶
type FetchSetCommandBuilder struct {
// contains filtered or unexported fields
}
FetchSetCommandBuilder type is required for creating new instances of FetchSetCommand
command := NewFetchSetCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithKey("myKey"). Build()
func NewFetchSetCommandBuilder ¶
func NewFetchSetCommandBuilder() *FetchSetCommandBuilder
NewFetchSetCommandBuilder is a factory function for generating the command builder struct
func (*FetchSetCommandBuilder) Build ¶
func (builder *FetchSetCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*FetchSetCommandBuilder) WithBasicQuorum ¶
func (builder *FetchSetCommandBuilder) WithBasicQuorum(basicQuorum bool) *FetchSetCommandBuilder
WithBasicQuorum sets basic_quorum, whether to return early in some failure cases (eg. when r=1 and you get 2 errors and a success basic_quorum=true would return an error)
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*FetchSetCommandBuilder) WithBucket ¶
func (builder *FetchSetCommandBuilder) WithBucket(bucket string) *FetchSetCommandBuilder
WithBucket sets the bucket to be used by the command
func (*FetchSetCommandBuilder) WithBucketType ¶
func (builder *FetchSetCommandBuilder) WithBucketType(bucketType string) *FetchSetCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*FetchSetCommandBuilder) WithKey ¶
func (builder *FetchSetCommandBuilder) WithKey(key string) *FetchSetCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*FetchSetCommandBuilder) WithNotFoundOk ¶
func (builder *FetchSetCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchSetCommandBuilder
WithNotFoundOk sets notfound_ok, whether to treat notfounds as successful reads for the purposes of R
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*FetchSetCommandBuilder) WithPr ¶
func (builder *FetchSetCommandBuilder) WithPr(pr uint32) *FetchSetCommandBuilder
WithPr sets the number of primary nodes (N) that must be read from in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*FetchSetCommandBuilder) WithR ¶
func (builder *FetchSetCommandBuilder) WithR(r uint32) *FetchSetCommandBuilder
WithR sets the number of nodes that must report back a successful read in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*FetchSetCommandBuilder) WithTimeout ¶
func (builder *FetchSetCommandBuilder) WithTimeout(timeout time.Duration) *FetchSetCommandBuilder
WithTimeout sets a timeout to be used for this command operation
type FetchSetResponse ¶
FetchSetResponse contains the response data for a FetchSetCommand
type FetchValueCommand ¶
type FetchValueCommand struct { Response *FetchValueResponse // contains filtered or unexported fields }
FetchValueCommand is used to fetch / get a value from Riak KV
func (*FetchValueCommand) Name ¶
func (cmd *FetchValueCommand) Name() string
Name identifies this command
type FetchValueCommandBuilder ¶
type FetchValueCommandBuilder struct {
// contains filtered or unexported fields
}
FetchValueCommandBuilder type is required for creating new instances of FetchValueCommand
command := NewFetchValueCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithKey("myKey"). Build()
func NewFetchValueCommandBuilder ¶
func NewFetchValueCommandBuilder() *FetchValueCommandBuilder
NewFetchValueCommandBuilder is a factory function for generating the command builder struct
func (*FetchValueCommandBuilder) Build ¶
func (builder *FetchValueCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*FetchValueCommandBuilder) WithBasicQuorum ¶
func (builder *FetchValueCommandBuilder) WithBasicQuorum(basicQuorum bool) *FetchValueCommandBuilder
WithBasicQuorum sets basic_quorum, whether to return early in some failure cases (eg. when r=1 and you get 2 errors and a success basic_quorum=true would return an error)
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*FetchValueCommandBuilder) WithBucket ¶
func (builder *FetchValueCommandBuilder) WithBucket(bucket string) *FetchValueCommandBuilder
WithBucket sets the bucket to be used by the command
func (*FetchValueCommandBuilder) WithBucketType ¶
func (builder *FetchValueCommandBuilder) WithBucketType(bucketType string) *FetchValueCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*FetchValueCommandBuilder) WithConflictResolver ¶
func (builder *FetchValueCommandBuilder) WithConflictResolver(resolver ConflictResolver) *FetchValueCommandBuilder
WithConflictResolver builds the command object with a user defined ConflictResolver for handling conflicting key values
func (*FetchValueCommandBuilder) WithHeadOnly ¶
func (builder *FetchValueCommandBuilder) WithHeadOnly(headOnly bool) *FetchValueCommandBuilder
WithHeadOnly returns only the meta data for the value, useful when objects contain large amounts of data
func (*FetchValueCommandBuilder) WithIfModified ¶
func (builder *FetchValueCommandBuilder) WithIfModified(ifModified []byte) *FetchValueCommandBuilder
WithIfModified tells Riak to only return the object if the vclock in Riak differs from what is provided
func (*FetchValueCommandBuilder) WithKey ¶
func (builder *FetchValueCommandBuilder) WithKey(key string) *FetchValueCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*FetchValueCommandBuilder) WithNVal ¶
func (builder *FetchValueCommandBuilder) WithNVal(nval uint32) *FetchValueCommandBuilder
WithNVal sets the number of times this command operation is replicated in the Cluster. If ommitted, the ring default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*FetchValueCommandBuilder) WithNotFoundOk ¶
func (builder *FetchValueCommandBuilder) WithNotFoundOk(notFoundOk bool) *FetchValueCommandBuilder
WithNotFoundOk sets notfound_ok, whether to treat notfounds as successful reads for the purposes of R
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*FetchValueCommandBuilder) WithPr ¶
func (builder *FetchValueCommandBuilder) WithPr(pr uint32) *FetchValueCommandBuilder
WithPr sets the number of primary nodes (N) that must be read from in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*FetchValueCommandBuilder) WithR ¶
func (builder *FetchValueCommandBuilder) WithR(r uint32) *FetchValueCommandBuilder
WithR sets the number of nodes that must report back a successful read in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*FetchValueCommandBuilder) WithReturnDeletedVClock ¶
func (builder *FetchValueCommandBuilder) WithReturnDeletedVClock(returnDeletedVClock bool) *FetchValueCommandBuilder
WithReturnDeletedVClock sets the command to return a Tombstone if any our found for the key across all of the vnodes
func (*FetchValueCommandBuilder) WithSloppyQuorum ¶
func (builder *FetchValueCommandBuilder) WithSloppyQuorum(sloppyQuorum bool) *FetchValueCommandBuilder
WithSloppyQuorum sets the sloppy_quorum for this Command
See http://docs.basho.com/riak/latest/theory/concepts/Eventual-Consistency/
func (*FetchValueCommandBuilder) WithTimeout ¶
func (builder *FetchValueCommandBuilder) WithTimeout(timeout time.Duration) *FetchValueCommandBuilder
WithTimeout sets a timeout to be used for this command operation
type FetchValueResponse ¶
FetchValueResponse contains the response data for a FetchValueCommand
type GetServerInfoCommand ¶ added in v1.6.0
type GetServerInfoCommand struct { Response *GetServerInfoResponse // contains filtered or unexported fields }
GetServerInfoCommand is used to get Riak server information
func (*GetServerInfoCommand) Name ¶ added in v1.6.0
func (cmd *GetServerInfoCommand) Name() string
Name identifies this command
type GetServerInfoResponse ¶ added in v1.6.0
GetServerInfoResponse contains the response data for Riak server information
type Link ¶
Link is used to represent a Riak KV object link, which is a one way link to another object within Riak
type ListBucketsCommand ¶
type ListBucketsCommand struct { Response *ListBucketsResponse // contains filtered or unexported fields }
ListBucketsCommand is used to list buckets in a bucket type
func (*ListBucketsCommand) Name ¶
func (cmd *ListBucketsCommand) Name() string
Name identifies this command
type ListBucketsCommandBuilder ¶
type ListBucketsCommandBuilder struct {
// contains filtered or unexported fields
}
ListBucketsCommandBuilder type is required for creating new instances of ListBucketsCommand
cb := func(buckets []string) error { // Do something with the result return nil } cmd := NewListBucketsCommandBuilder(). WithBucketType("myBucketType"). WithStreaming(true). WithCallback(cb). Build()
func NewListBucketsCommandBuilder ¶
func NewListBucketsCommandBuilder() *ListBucketsCommandBuilder
NewListBucketsCommandBuilder is a factory function for generating the command builder struct
func (*ListBucketsCommandBuilder) Build ¶
func (builder *ListBucketsCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*ListBucketsCommandBuilder) WithBucketType ¶
func (builder *ListBucketsCommandBuilder) WithBucketType(bucketType string) *ListBucketsCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*ListBucketsCommandBuilder) WithCallback ¶
func (builder *ListBucketsCommandBuilder) WithCallback(callback func([]string) error) *ListBucketsCommandBuilder
WithCallback sets the callback to be used when handling a streaming response
Requires WithStreaming(true)
func (*ListBucketsCommandBuilder) WithStreaming ¶
func (builder *ListBucketsCommandBuilder) WithStreaming(streaming bool) *ListBucketsCommandBuilder
WithStreaming sets the command to provide a streamed response
If true, a callback must be provided via WithCallback()
func (*ListBucketsCommandBuilder) WithTimeout ¶
func (builder *ListBucketsCommandBuilder) WithTimeout(timeout time.Duration) *ListBucketsCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
type ListBucketsResponse ¶
type ListBucketsResponse struct {
Buckets []string
}
ListBucketsResponse contains the response data for a ListBucketsCommand
type ListKeysCommand ¶
type ListKeysCommand struct { Response *ListKeysResponse // contains filtered or unexported fields }
ListKeysCommand is used to fetch a list of keys within a bucket from Riak KV
func (*ListKeysCommand) Name ¶
func (cmd *ListKeysCommand) Name() string
Name identifies this command
type ListKeysCommandBuilder ¶
type ListKeysCommandBuilder struct {
// contains filtered or unexported fields
}
ListKeysCommandBuilder type is required for creating new instances of ListKeysCommand
cb := func(buckets []string) error { // Do something with the result return nil } cmd := NewListKeysCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithStreaming(true). WithCallback(cb). Build()
func NewListKeysCommandBuilder ¶
func NewListKeysCommandBuilder() *ListKeysCommandBuilder
NewListKeysCommandBuilder is a factory function for generating the command builder struct
func (*ListKeysCommandBuilder) Build ¶
func (builder *ListKeysCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*ListKeysCommandBuilder) WithBucket ¶
func (builder *ListKeysCommandBuilder) WithBucket(bucket string) *ListKeysCommandBuilder
WithBucket sets the bucket to be used by the command
func (*ListKeysCommandBuilder) WithBucketType ¶
func (builder *ListKeysCommandBuilder) WithBucketType(bucketType string) *ListKeysCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*ListKeysCommandBuilder) WithCallback ¶
func (builder *ListKeysCommandBuilder) WithCallback(callback func([]string) error) *ListKeysCommandBuilder
WithCallback sets the callback to be used when handling a streaming response
Requires WithStreaming(true)
func (*ListKeysCommandBuilder) WithStreaming ¶
func (builder *ListKeysCommandBuilder) WithStreaming(streaming bool) *ListKeysCommandBuilder
WithStreaming sets the command to provide a streamed response
If true, a callback must be provided via WithCallback()
func (*ListKeysCommandBuilder) WithTimeout ¶
func (builder *ListKeysCommandBuilder) WithTimeout(timeout time.Duration) *ListKeysCommandBuilder
WithTimeout sets a timeout to be used for this command operation
type ListKeysResponse ¶
type ListKeysResponse struct {
Keys []string
}
ListKeysResponse contains the response data for a ListKeysCommand
type Map ¶
type Map struct { Counters map[string]int64 Sets map[string][][]byte Registers map[string][]byte Flags map[string]bool Maps map[string]*Map }
Map object represents the Riak Map object and is returned within the Response objects for both UpdateMapCommand and FetchMapCommand
type MapOperation ¶
type MapOperation struct {
// contains filtered or unexported fields
}
MapOperation contains the instructions to send to Riak what updates to the Map you want to complete
func (*MapOperation) AddToSet ¶
func (mapOp *MapOperation) AddToSet(key string, value []byte) *MapOperation
AddToSet adds an element to the child set CRDT of the map at the specified key
func (*MapOperation) IncrementCounter ¶
func (mapOp *MapOperation) IncrementCounter(key string, increment int64) *MapOperation
IncrementCounter increments a child counter CRDT of the map at the specified key
func (*MapOperation) Map ¶
func (mapOp *MapOperation) Map(key string) *MapOperation
Map returns a nested map operation for manipulation
func (*MapOperation) RemoveCounter ¶
func (mapOp *MapOperation) RemoveCounter(key string) *MapOperation
RemoveCounter removes a child counter CRDT from the map at the specified key
func (*MapOperation) RemoveFlag ¶
func (mapOp *MapOperation) RemoveFlag(key string) *MapOperation
RemoveFlag removes a flag CRDT from the map
func (*MapOperation) RemoveFromSet ¶
func (mapOp *MapOperation) RemoveFromSet(key string, value []byte) *MapOperation
RemoveFromSet removes elements from the child set CRDT of the map at the specified key
func (*MapOperation) RemoveMap ¶
func (mapOp *MapOperation) RemoveMap(key string) *MapOperation
RemoveMap removes a nested map from the map
func (*MapOperation) RemoveRegister ¶
func (mapOp *MapOperation) RemoveRegister(key string) *MapOperation
RemoveRegister removes a register CRDT from the map
func (*MapOperation) RemoveSet ¶
func (mapOp *MapOperation) RemoveSet(key string) *MapOperation
RemoveSet removes the child set CRDT from the map
func (*MapOperation) SetFlag ¶
func (mapOp *MapOperation) SetFlag(key string, value bool) *MapOperation
SetFlag sets a flag CRDT on the map
func (*MapOperation) SetRegister ¶
func (mapOp *MapOperation) SetRegister(key string, value []byte) *MapOperation
SetRegister sets a register CRDT on the map with the provided value
type MapReduceCommand ¶
type MapReduceCommand struct { Response [][]byte // contains filtered or unexported fields }
MapReduceCommand is used to fetch keys or data from Riak KV using the MapReduce technique
func (*MapReduceCommand) Name ¶
func (cmd *MapReduceCommand) Name() string
Name identifies this command
type MapReduceCommandBuilder ¶
type MapReduceCommandBuilder struct {
// contains filtered or unexported fields
}
MapReduceCommandBuilder type is required for creating new instances of MapReduceCommand
command := NewMapReduceCommandBuilder(). WithQuery("myMapReduceQuery"). Build()
func NewMapReduceCommandBuilder ¶
func NewMapReduceCommandBuilder() *MapReduceCommandBuilder
NewMapReduceCommandBuilder is a factory function for generating the command builder struct
func (*MapReduceCommandBuilder) Build ¶
func (builder *MapReduceCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*MapReduceCommandBuilder) WithCallback ¶
func (builder *MapReduceCommandBuilder) WithCallback(callback func([]byte) error) *MapReduceCommandBuilder
WithCallback sets the callback to be used when handling a streaming response
Requires WithStreaming(true)
func (*MapReduceCommandBuilder) WithQuery ¶
func (builder *MapReduceCommandBuilder) WithQuery(query string) *MapReduceCommandBuilder
WithQuery sets the map reduce query to be executed on Riak
func (*MapReduceCommandBuilder) WithStreaming ¶
func (builder *MapReduceCommandBuilder) WithStreaming(streaming bool) *MapReduceCommandBuilder
WithStreaming sets the command to provide a streamed response
If true, a callback must be provided via WithCallback()
type ModFun ¶
ModFun is used when fetching or updating LinkFun or ChashKeyfun bucket properties on Riak
type NewClientOptions ¶
type NewClientOptions struct { Cluster *Cluster Port uint16 // NB: if specified, all connections will use this value if port is not provided RemoteAddresses []string // NB: in the form HOST|IP[:PORT] }
Options for creating a new Client. Either Cluster or Port/RemoteAddress information must be provided
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a struct that contains all of the information needed to connect and maintain connections with a Riak KV instance
func NewNode ¶
func NewNode(options *NodeOptions) (*Node, error)
NewNode is a factory function that takes a NodeOptions struct and returns a Node struct
type NodeManager ¶
type NodeManager interface {
ExecuteOnNode(nodes []*Node, command Command, previousNode *Node) (bool, error)
}
NodeManager enforces the structure needed to if going to implement your own NodeManager
type NodeOptions ¶
type NodeOptions struct { RemoteAddress string MinConnections uint16 MaxConnections uint16 TempNetErrorRetries uint16 IdleTimeout time.Duration ConnectTimeout time.Duration RequestTimeout time.Duration HealthCheckInterval time.Duration HealthCheckBuilder CommandBuilder AuthOptions *AuthOptions }
NodeOptions defines the RemoteAddress and operational configuration for connections to a Riak KV instance
type Object ¶
type Object struct { BucketType string Bucket string Key string IsTombstone bool Value []byte ContentType string Charset string ContentEncoding string VTag string LastModified time.Time UserMeta []*Pair Indexes map[string][]string Links []*Link VClock []byte }
Object structure used for representing a KV Riak object
func (*Object) AddToIndex ¶
AddToIndex adds the object to the specified secondary index with the string value to be used for index searches
func (*Object) AddToIntIndex ¶
AddToIntIndex adds the object to the specified secondary index with the integer value to be used for index searches
func (*Object) HasIndexes ¶
HasIndexes is a bool check to determine if the object contains any secondary indexes for searching
func (*Object) HasUserMeta ¶
HasUserMeta is a bool check to determine if the object contains any user defined meta data
type PingCommand ¶
type PingCommand struct {
// contains filtered or unexported fields
}
PingCommand is used to verify Riak is online and reachable
type PingCommandBuilder ¶
type PingCommandBuilder struct { }
PingCommandBuilder is the command builder required for PingCommand
func (*PingCommandBuilder) Build ¶
func (builder *PingCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
type PreflistItem ¶
PreflistItem represents an individual result from the FetchPreflistResponse result set
type ResetBucketCommand ¶ added in v1.4.0
type ResetBucketCommand struct {
// contains filtered or unexported fields
}
PingCommand is used to verify Riak is online and reachable
func (*ResetBucketCommand) Name ¶ added in v1.4.0
func (cmd *ResetBucketCommand) Name() string
Name identifies this command
type ResetBucketCommandBuilder ¶ added in v1.4.0
type ResetBucketCommandBuilder struct {
// contains filtered or unexported fields
}
ResetBucketCommandBuilder is the command builder for ResetBucketCommand
func NewResetBucketCommandBuilder ¶ added in v1.4.0
func NewResetBucketCommandBuilder() *ResetBucketCommandBuilder
NewResetBucketCommandBuilder is a factory function for generating the command builder struct
func (*ResetBucketCommandBuilder) Build ¶ added in v1.4.0
func (builder *ResetBucketCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*ResetBucketCommandBuilder) WithBucket ¶ added in v1.4.0
func (builder *ResetBucketCommandBuilder) WithBucket(bucket string) *ResetBucketCommandBuilder
WithBucket sets the bucket to be used by the command
func (*ResetBucketCommandBuilder) WithBucketType ¶ added in v1.4.0
func (builder *ResetBucketCommandBuilder) WithBucketType(bucketType string) *ResetBucketCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
type SearchCommand ¶
type SearchCommand struct { Response *SearchResponse // contains filtered or unexported fields }
SearchCommand is used to search Riak for values using search indexes & schemas
type SearchCommandBuilder ¶
type SearchCommandBuilder struct {
// contains filtered or unexported fields
}
SearchCommandBuilder type is required for creating new instances of SearchCommand
command := NewSearchCommandBuilder(). WithIndexName("myIndexName"). WithQuery("mySolrQuery"). WithNumRows(100). Build()
func NewSearchCommandBuilder ¶
func NewSearchCommandBuilder() *SearchCommandBuilder
NewSearchCommandBuilder is a factory function for generating the command builder struct
func (*SearchCommandBuilder) Build ¶
func (builder *SearchCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*SearchCommandBuilder) WithDefaultField ¶
func (builder *SearchCommandBuilder) WithDefaultField(defaultField string) *SearchCommandBuilder
WithDefaultField sets the default field to be used by Riak the search query
func (*SearchCommandBuilder) WithDefaultOperation ¶
func (builder *SearchCommandBuilder) WithDefaultOperation(op string) *SearchCommandBuilder
WithDefaultOperation sets the default operation to be used by Riak for the search query
func (*SearchCommandBuilder) WithFilterQuery ¶
func (builder *SearchCommandBuilder) WithFilterQuery(filterQuery string) *SearchCommandBuilder
WithFilterQuery sets the solr filter query to be used, the main query runs first, the filter query reduces the scope of the result set even further
func (*SearchCommandBuilder) WithIndexName ¶
func (builder *SearchCommandBuilder) WithIndexName(index string) *SearchCommandBuilder
WithIndexName sets the index to use for the command
func (*SearchCommandBuilder) WithNumRows ¶
func (builder *SearchCommandBuilder) WithNumRows(numRows uint32) *SearchCommandBuilder
WithNumRows sets the number of documents to be returned by Riak
func (*SearchCommandBuilder) WithPresort ¶
func (builder *SearchCommandBuilder) WithPresort(presort string) *SearchCommandBuilder
WithPresort allows you to configure Riak to presort the result set by Key or Score
func (*SearchCommandBuilder) WithQuery ¶
func (builder *SearchCommandBuilder) WithQuery(query string) *SearchCommandBuilder
WithQuery sets the solr query to be executed on Riak
func (*SearchCommandBuilder) WithReturnFields ¶
func (builder *SearchCommandBuilder) WithReturnFields(fields ...string) *SearchCommandBuilder
WithReturnFields sets the fields to be returned within each document
func (*SearchCommandBuilder) WithSortField ¶
func (builder *SearchCommandBuilder) WithSortField(sortField string) *SearchCommandBuilder
WithSortField defines which field should be used for sorting the result set
func (*SearchCommandBuilder) WithStart ¶
func (builder *SearchCommandBuilder) WithStart(start uint32) *SearchCommandBuilder
WithStart sets the document to start the result set with
type SearchDoc ¶
type SearchDoc struct { BucketType string Bucket string Key string Id string Score string Fields map[string][]string }
SearchDoc object representing solr document returned from Riak
type SearchIndex ¶
SearchIndex object representing the solr index that is returned from Riak
type SearchResponse ¶
SearchResponse contains the response data for a SearchCommand
type SecondaryIndexQueryCommand ¶
type SecondaryIndexQueryCommand struct { Response *SecondaryIndexQueryResponse // contains filtered or unexported fields }
SecondaryIndexQueryCommand is used to query for keys from Riak KV using secondary indexes
func (*SecondaryIndexQueryCommand) Error ¶ added in v1.2.0
func (cmd *SecondaryIndexQueryCommand) Error() error
func (*SecondaryIndexQueryCommand) Name ¶
func (cmd *SecondaryIndexQueryCommand) Name() string
Name identifies this command
type SecondaryIndexQueryCommandBuilder ¶
type SecondaryIndexQueryCommandBuilder struct {
// contains filtered or unexported fields
}
SecondaryIndexQueryCommandBuilder type is required for creating new instances of SecondaryIndexQueryCommand
command := NewSecondaryIndexQueryCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithIndexName("myIndexName"). WithIndexKey("myIndexKey"). WithIntIndexKey(1234). Build()
func NewSecondaryIndexQueryCommandBuilder ¶
func NewSecondaryIndexQueryCommandBuilder() *SecondaryIndexQueryCommandBuilder
NewSecondaryIndexQueryCommandBuilder is a factory function for generating the command builder struct
func (*SecondaryIndexQueryCommandBuilder) Build ¶
func (builder *SecondaryIndexQueryCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*SecondaryIndexQueryCommandBuilder) WithBucket ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithBucket(bucket string) *SecondaryIndexQueryCommandBuilder
WithBucket sets the bucket to be used by the command
func (*SecondaryIndexQueryCommandBuilder) WithBucketType ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithBucketType(bucketType string) *SecondaryIndexQueryCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*SecondaryIndexQueryCommandBuilder) WithCallback ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithCallback(callback func([]*SecondaryIndexQueryResult) error) *SecondaryIndexQueryCommandBuilder
WithCallback sets the callback to be used when handling a streaming response
Requires WithStreaming(true)
func (*SecondaryIndexQueryCommandBuilder) WithContinuation ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithContinuation(cont []byte) *SecondaryIndexQueryCommandBuilder
WithContinuation sets the position at which the result set should continue from, value can be found within the result set of the previous page for the same query
func (*SecondaryIndexQueryCommandBuilder) WithIndexKey ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithIndexKey(key string) *SecondaryIndexQueryCommandBuilder
WithIndexKey defines the index to search against
func (*SecondaryIndexQueryCommandBuilder) WithIndexName ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithIndexName(indexName string) *SecondaryIndexQueryCommandBuilder
WithIndexName sets the index to use for the command
func (*SecondaryIndexQueryCommandBuilder) WithIntIndexKey ¶ added in v1.6.0
func (builder *SecondaryIndexQueryCommandBuilder) WithIntIndexKey(key int) *SecondaryIndexQueryCommandBuilder
WithIntIndexKey defines the integer index to search against
func (*SecondaryIndexQueryCommandBuilder) WithIntRange ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithIntRange(min int64, max int64) *SecondaryIndexQueryCommandBuilder
WithIntRange sets the range of integer type index values to return, useful when you want 1,3,5,11 and not 1,11,3,5
func (*SecondaryIndexQueryCommandBuilder) WithMaxResults ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithMaxResults(maxResults uint32) *SecondaryIndexQueryCommandBuilder
WithMaxResults sets the maximum number of values to return in the result set
func (*SecondaryIndexQueryCommandBuilder) WithPaginationSort ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithPaginationSort(paginationSort bool) *SecondaryIndexQueryCommandBuilder
WithPaginationSort set to true, the results of a non-paginated query will return sorted from Riak
func (*SecondaryIndexQueryCommandBuilder) WithRange ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithRange(min string, max string) *SecondaryIndexQueryCommandBuilder
WithRange sets the range of index values to return
func (*SecondaryIndexQueryCommandBuilder) WithReturnKeyAndIndex ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithReturnKeyAndIndex(val bool) *SecondaryIndexQueryCommandBuilder
WithReturnKeyAndIndex set to true, the result set will include both index keys and object keys
func (*SecondaryIndexQueryCommandBuilder) WithStreaming ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithStreaming(streaming bool) *SecondaryIndexQueryCommandBuilder
WithStreaming sets the command to provide a streamed response
If true, a callback must be provided via WithCallback()
func (*SecondaryIndexQueryCommandBuilder) WithTermRegex ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithTermRegex(regex string) *SecondaryIndexQueryCommandBuilder
WithTermRegex sets the regex pattern to filter the result set by
func (*SecondaryIndexQueryCommandBuilder) WithTimeout ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithTimeout(timeout time.Duration) *SecondaryIndexQueryCommandBuilder
WithTimeout sets a timeout to be used for this command operation
type SecondaryIndexQueryResponse ¶
type SecondaryIndexQueryResponse struct { Results []*SecondaryIndexQueryResult Continuation []byte }
SecondaryIndexQueryResponse contains the response data for a SecondaryIndexQueryCommand
type SecondaryIndexQueryResult ¶
SecondaryIndexQueryResult represents an individual result of the SecondaryIndexQueryResponse result set
type StoreBucketPropsCommand ¶
type StoreBucketPropsCommand struct {
// contains filtered or unexported fields
}
StoreBucketPropsCommand is used to store changes to a buckets properties
func (*StoreBucketPropsCommand) Error ¶ added in v1.2.0
func (cmd *StoreBucketPropsCommand) Error() error
func (*StoreBucketPropsCommand) Name ¶
func (cmd *StoreBucketPropsCommand) Name() string
Name identifies this command
type StoreBucketPropsCommandBuilder ¶
type StoreBucketPropsCommandBuilder struct {
// contains filtered or unexported fields
}
StoreBucketPropsCommandBuilder type is required for creating new instances of StoreBucketPropsCommand
command := NewStoreBucketPropsCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithAllowMult(true). Build()
func NewStoreBucketPropsCommandBuilder ¶
func NewStoreBucketPropsCommandBuilder() *StoreBucketPropsCommandBuilder
NewStoreBucketPropsCommandBuilder is a factory function for generating the command builder struct
func (*StoreBucketPropsCommandBuilder) AddPostCommit ¶
func (builder *StoreBucketPropsCommandBuilder) AddPostCommit(commitHook *CommitHook) *StoreBucketPropsCommandBuilder
AddPostCommit allows you to attach a postcommit hook to the bucket
See http://docs.basho.com/riak/latest/dev/using/commit-hooks/
func (*StoreBucketPropsCommandBuilder) AddPreCommit ¶
func (builder *StoreBucketPropsCommandBuilder) AddPreCommit(commitHook *CommitHook) *StoreBucketPropsCommandBuilder
AddPreCommit allows you to attach a precommit hook to the bucket
See http://docs.basho.com/riak/latest/dev/using/commit-hooks/
func (*StoreBucketPropsCommandBuilder) Build ¶
func (builder *StoreBucketPropsCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*StoreBucketPropsCommandBuilder) WithAllowMult ¶
func (builder *StoreBucketPropsCommandBuilder) WithAllowMult(allowMult bool) *StoreBucketPropsCommandBuilder
WithAllowMult sets whether or not to allow Riak to store siblings of an object when writes conflict
func (*StoreBucketPropsCommandBuilder) WithBackend ¶
func (builder *StoreBucketPropsCommandBuilder) WithBackend(backend string) *StoreBucketPropsCommandBuilder
WithBackend sets the backend to be used for this bucket
func (*StoreBucketPropsCommandBuilder) WithBasicQuorum ¶
func (builder *StoreBucketPropsCommandBuilder) WithBasicQuorum(basicQuorum bool) *StoreBucketPropsCommandBuilder
WithBasicQuorum sets basic_quorum, whether to return early in some failure cases (eg. when r=1 and you get 2 errors and a success basic_quorum=true would return an error)
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*StoreBucketPropsCommandBuilder) WithBigVClock ¶
func (builder *StoreBucketPropsCommandBuilder) WithBigVClock(bigVClock uint32) *StoreBucketPropsCommandBuilder
WithBigVClock sets the big_vclock value representing an epoch time value
func (*StoreBucketPropsCommandBuilder) WithBucket ¶
func (builder *StoreBucketPropsCommandBuilder) WithBucket(bucket string) *StoreBucketPropsCommandBuilder
WithBucket sets the bucket to be used by the command
func (*StoreBucketPropsCommandBuilder) WithBucketType ¶
func (builder *StoreBucketPropsCommandBuilder) WithBucketType(bucketType string) *StoreBucketPropsCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*StoreBucketPropsCommandBuilder) WithChashKeyFun ¶
func (builder *StoreBucketPropsCommandBuilder) WithChashKeyFun(val *ModFun) *StoreBucketPropsCommandBuilder
WithChashKeyFun sets the chash_keyfun property on the bucket which allows custom hashing functions Please note, this is an advanced feature, only use with caution
func (*StoreBucketPropsCommandBuilder) WithDw ¶
func (builder *StoreBucketPropsCommandBuilder) WithDw(dw uint32) *StoreBucketPropsCommandBuilder
WithDw (durable writes) sets the number of nodes that must report back a successful write to backend storage in order for the command operation to be considered a success by Riak. If omitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketPropsCommandBuilder) WithLastWriteWins ¶
func (builder *StoreBucketPropsCommandBuilder) WithLastWriteWins(lww bool) *StoreBucketPropsCommandBuilder
WithLastWriteWins sets whether Riak should resolve conflicts using timestamp (most recent wins)
func (*StoreBucketPropsCommandBuilder) WithNVal ¶
func (builder *StoreBucketPropsCommandBuilder) WithNVal(nval uint32) *StoreBucketPropsCommandBuilder
WithNVal sets the number of times this command operation is replicated in the Cluster. If omitted, the ring default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketPropsCommandBuilder) WithNotFoundOk ¶
func (builder *StoreBucketPropsCommandBuilder) WithNotFoundOk(notFoundOk bool) *StoreBucketPropsCommandBuilder
WithNotFoundOk sets notfound_ok, whether to treat notfounds as successful reads for the purposes of R
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*StoreBucketPropsCommandBuilder) WithOldVClock ¶
func (builder *StoreBucketPropsCommandBuilder) WithOldVClock(oldVClock uint32) *StoreBucketPropsCommandBuilder
WithOldVClock sets the old_vclock value representing an epoch time value
func (*StoreBucketPropsCommandBuilder) WithPr ¶
func (builder *StoreBucketPropsCommandBuilder) WithPr(pr uint32) *StoreBucketPropsCommandBuilder
WithPr sets the number of primary nodes (N) that must be read from in order for the command operation to be considered a success by Riak.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketPropsCommandBuilder) WithPw ¶
func (builder *StoreBucketPropsCommandBuilder) WithPw(pw uint32) *StoreBucketPropsCommandBuilder
WithPw sets the number of primary nodes (N) that must report back a successful write in order for the command operation to be considered a success by Riak.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketPropsCommandBuilder) WithR ¶
func (builder *StoreBucketPropsCommandBuilder) WithR(r uint32) *StoreBucketPropsCommandBuilder
WithR sets the number of nodes that must report back a successful read in order for the command operation to be considered a success by Riak.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketPropsCommandBuilder) WithRw ¶
func (builder *StoreBucketPropsCommandBuilder) WithRw(rw uint32) *StoreBucketPropsCommandBuilder
WithRw (delete quorum) sets the number of nodes that must report back a successful delete to backend storage in order for the command operation to be considered a success by Riak. It represents the read and write operations that are completed internal to Riak to complete a delete.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketPropsCommandBuilder) WithSearch ¶
func (builder *StoreBucketPropsCommandBuilder) WithSearch(search bool) *StoreBucketPropsCommandBuilder
WithSearch enables / disables search features for this bucket
func (*StoreBucketPropsCommandBuilder) WithSearchIndex ¶
func (builder *StoreBucketPropsCommandBuilder) WithSearchIndex(searchIndex string) *StoreBucketPropsCommandBuilder
WithSearchIndex sets a searchIndex to be used on the bucket
func (*StoreBucketPropsCommandBuilder) WithSmallVClock ¶
func (builder *StoreBucketPropsCommandBuilder) WithSmallVClock(smallVClock uint32) *StoreBucketPropsCommandBuilder
WithSmallVClock sets the old_vclock value representing an epoch time value
func (*StoreBucketPropsCommandBuilder) WithW ¶
func (builder *StoreBucketPropsCommandBuilder) WithW(w uint32) *StoreBucketPropsCommandBuilder
WithW sets the number of nodes that must report back a successful write in order for the command operation to be considered a success by Riak.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketPropsCommandBuilder) WithYoungVClock ¶
func (builder *StoreBucketPropsCommandBuilder) WithYoungVClock(youngVClock uint32) *StoreBucketPropsCommandBuilder
WithYoungVClock sets the old_vclock value representing an epoch time value
type StoreBucketTypePropsCommand ¶ added in v1.5.0
type StoreBucketTypePropsCommand struct {
// contains filtered or unexported fields
}
StoreBucketTypePropsCommand is used to store changes to a bucket type's properties
func (*StoreBucketTypePropsCommand) Error ¶ added in v1.5.0
func (cmd *StoreBucketTypePropsCommand) Error() error
func (*StoreBucketTypePropsCommand) Name ¶ added in v1.5.0
func (cmd *StoreBucketTypePropsCommand) Name() string
Name identifies this command
type StoreBucketTypePropsCommandBuilder ¶ added in v1.5.0
type StoreBucketTypePropsCommandBuilder struct {
// contains filtered or unexported fields
}
StoreBucketTypePropsCommandBuilder type is required for creating new instances of StoreBucketTypePropsCommand
command := NewStoreBucketTypePropsCommandBuilder(). WithBucketType("myBucketType"). WithAllowMult(true). Build()
func NewStoreBucketTypePropsCommandBuilder ¶ added in v1.5.0
func NewStoreBucketTypePropsCommandBuilder() *StoreBucketTypePropsCommandBuilder
NewStoreBucketTypePropsCommandBuilder is a factory function for generating the command builder struct
func (*StoreBucketTypePropsCommandBuilder) AddPostCommit ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) AddPostCommit(commitHook *CommitHook) *StoreBucketTypePropsCommandBuilder
AddPostCommit allows you to attach a postcommit hook to the bucket
See http://docs.basho.com/riak/latest/dev/using/commit-hooks/
func (*StoreBucketTypePropsCommandBuilder) AddPreCommit ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) AddPreCommit(commitHook *CommitHook) *StoreBucketTypePropsCommandBuilder
AddPreCommit allows you to attach a precommit hook to the bucket
See http://docs.basho.com/riak/latest/dev/using/commit-hooks/
func (*StoreBucketTypePropsCommandBuilder) Build ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*StoreBucketTypePropsCommandBuilder) WithAllowMult ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithAllowMult(allowMult bool) *StoreBucketTypePropsCommandBuilder
WithAllowMult sets whether or not to allow Riak to store siblings of an object when writes conflict
func (*StoreBucketTypePropsCommandBuilder) WithBackend ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithBackend(backend string) *StoreBucketTypePropsCommandBuilder
WithBackend sets the backend to be used for this bucket
func (*StoreBucketTypePropsCommandBuilder) WithBasicQuorum ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithBasicQuorum(basicQuorum bool) *StoreBucketTypePropsCommandBuilder
WithBasicQuorum sets basic_quorum, whether to return early in some failure cases (eg. when r=1 and you get 2 errors and a success basic_quorum=true would return an error)
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*StoreBucketTypePropsCommandBuilder) WithBigVClock ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithBigVClock(bigVClock uint32) *StoreBucketTypePropsCommandBuilder
WithBigVClock sets the big_vclock value representing an epoch time value
func (*StoreBucketTypePropsCommandBuilder) WithBucketType ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithBucketType(bucketType string) *StoreBucketTypePropsCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*StoreBucketTypePropsCommandBuilder) WithChashKeyFun ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithChashKeyFun(val *ModFun) *StoreBucketTypePropsCommandBuilder
WithChashKeyFun sets the chash_keyfun property on the bucket which allows custom hashing functions Please note, this is an advanced feature, only use with caution
func (*StoreBucketTypePropsCommandBuilder) WithDw ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithDw(dw uint32) *StoreBucketTypePropsCommandBuilder
WithDw (durable writes) sets the number of nodes that must report back a successful write to backend storage in order for the command operation to be considered a success by Riak. If omitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketTypePropsCommandBuilder) WithLastWriteWins ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithLastWriteWins(lww bool) *StoreBucketTypePropsCommandBuilder
WithLastWriteWins sets whether Riak should resolve conflicts using timestamp (most recent wins)
func (*StoreBucketTypePropsCommandBuilder) WithNVal ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithNVal(nval uint32) *StoreBucketTypePropsCommandBuilder
WithNVal sets the number of times this command operation is replicated in the Cluster. If omitted, the ring default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketTypePropsCommandBuilder) WithNotFoundOk ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithNotFoundOk(notFoundOk bool) *StoreBucketTypePropsCommandBuilder
WithNotFoundOk sets notfound_ok, whether to treat notfounds as successful reads for the purposes of R
See http://basho.com/posts/technical/riaks-config-behaviors-part-3/
func (*StoreBucketTypePropsCommandBuilder) WithOldVClock ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithOldVClock(oldVClock uint32) *StoreBucketTypePropsCommandBuilder
WithOldVClock sets the old_vclock value representing an epoch time value
func (*StoreBucketTypePropsCommandBuilder) WithPr ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithPr(pr uint32) *StoreBucketTypePropsCommandBuilder
WithPr sets the number of primary nodes (N) that must be read from in order for the command operation to be considered a success by Riak.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketTypePropsCommandBuilder) WithPw ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithPw(pw uint32) *StoreBucketTypePropsCommandBuilder
WithPw sets the number of primary nodes (N) that must report back a successful write in order for the command operation to be considered a success by Riak.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketTypePropsCommandBuilder) WithR ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithR(r uint32) *StoreBucketTypePropsCommandBuilder
WithR sets the number of nodes that must report back a successful read in order for the command operation to be considered a success by Riak.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketTypePropsCommandBuilder) WithRw ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithRw(rw uint32) *StoreBucketTypePropsCommandBuilder
WithRw (delete quorum) sets the number of nodes that must report back a successful delete to backend storage in order for the command operation to be considered a success by Riak. It represents the read and write operations that are completed internal to Riak to complete a delete.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketTypePropsCommandBuilder) WithSearch ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithSearch(search bool) *StoreBucketTypePropsCommandBuilder
WithSearch enables / disables search features for this bucket
func (*StoreBucketTypePropsCommandBuilder) WithSearchIndex ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithSearchIndex(searchIndex string) *StoreBucketTypePropsCommandBuilder
WithSearchIndex sets a searchIndex to be used on the bucket
func (*StoreBucketTypePropsCommandBuilder) WithSmallVClock ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithSmallVClock(smallVClock uint32) *StoreBucketTypePropsCommandBuilder
WithSmallVClock sets the old_vclock value representing an epoch time value
func (*StoreBucketTypePropsCommandBuilder) WithW ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithW(w uint32) *StoreBucketTypePropsCommandBuilder
WithW sets the number of nodes that must report back a successful write in order for the command operation to be considered a success by Riak.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketTypePropsCommandBuilder) WithYoungVClock ¶ added in v1.5.0
func (builder *StoreBucketTypePropsCommandBuilder) WithYoungVClock(youngVClock uint32) *StoreBucketTypePropsCommandBuilder
WithYoungVClock sets the old_vclock value representing an epoch time value
type StoreIndexCommand ¶
type StoreIndexCommand struct { Response bool // contains filtered or unexported fields }
StoreIndexCommand is sused to store a new search index on Riak
func (*StoreIndexCommand) Name ¶
func (cmd *StoreIndexCommand) Name() string
Name identifies this command
type StoreIndexCommandBuilder ¶
type StoreIndexCommandBuilder struct {
// contains filtered or unexported fields
}
StoreIndexCommandBuilder type is required for creating new instances of StoreIndexCommand
command := NewStoreIndexCommandBuilder(). WithIndexName("myIndexName"). WithSchemaName("mySchemaName"). Build()
func NewStoreIndexCommandBuilder ¶
func NewStoreIndexCommandBuilder() *StoreIndexCommandBuilder
NewStoreIndexCommandBuilder is a factory function for generating the command builder struct
func (*StoreIndexCommandBuilder) Build ¶
func (builder *StoreIndexCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*StoreIndexCommandBuilder) WithIndexName ¶
func (builder *StoreIndexCommandBuilder) WithIndexName(indexName string) *StoreIndexCommandBuilder
WithIndexName sets the index to use for the command
func (*StoreIndexCommandBuilder) WithNVal ¶
func (builder *StoreIndexCommandBuilder) WithNVal(nval uint32) *StoreIndexCommandBuilder
WithNVal sets the number of times this command operation is replicated in the Cluster. If ommitted, the ring default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreIndexCommandBuilder) WithSchemaName ¶
func (builder *StoreIndexCommandBuilder) WithSchemaName(schemaName string) *StoreIndexCommandBuilder
WithSchemaName sets the schema that the command will use
func (*StoreIndexCommandBuilder) WithTimeout ¶
func (builder *StoreIndexCommandBuilder) WithTimeout(timeout time.Duration) *StoreIndexCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
type StoreSchemaCommand ¶
type StoreSchemaCommand struct { Response bool // contains filtered or unexported fields }
StoreSchemaCommand is used to store / update a search schema in Riak
func (*StoreSchemaCommand) Name ¶
func (cmd *StoreSchemaCommand) Name() string
Name identifies this command
type StoreSchemaCommandBuilder ¶
type StoreSchemaCommandBuilder struct {
// contains filtered or unexported fields
}
StoreSchemaCommandBuilder type is required for creating new instances of StoreSchemaCommand
command := NewStoreSchemaCommandBuilder(). WithSchemaName("mySchemaName"). WithSchema("mySchemaXML"). Build()
func NewStoreSchemaCommandBuilder ¶
func NewStoreSchemaCommandBuilder() *StoreSchemaCommandBuilder
NewStoreSchemaCommandBuilder is a factory function for generating the command builder struct
func (*StoreSchemaCommandBuilder) Build ¶
func (builder *StoreSchemaCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*StoreSchemaCommandBuilder) WithSchema ¶
func (builder *StoreSchemaCommandBuilder) WithSchema(schema string) *StoreSchemaCommandBuilder
WithSchema sets the actual schema that solr will use for indexing and queries
func (*StoreSchemaCommandBuilder) WithSchemaName ¶
func (builder *StoreSchemaCommandBuilder) WithSchemaName(schemaName string) *StoreSchemaCommandBuilder
WithSchemaName sets the name for the schema to be stored
type StoreValueCommand ¶
type StoreValueCommand struct { Response *StoreValueResponse // contains filtered or unexported fields }
StoreValueCommand used to store a value from Riak KV.
func (*StoreValueCommand) Name ¶
func (cmd *StoreValueCommand) Name() string
Name identifies this command
type StoreValueCommandBuilder ¶
type StoreValueCommandBuilder struct {
// contains filtered or unexported fields
}
StoreValueCommandBuilder type is required for creating new instances of StoreValueCommand
command := NewStoreValueCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). Build()
func NewStoreValueCommandBuilder ¶
func NewStoreValueCommandBuilder() *StoreValueCommandBuilder
NewStoreValueCommandBuilder is a factory function for generating the command builder struct
func (*StoreValueCommandBuilder) Build ¶
func (builder *StoreValueCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*StoreValueCommandBuilder) WithAsis ¶
func (builder *StoreValueCommandBuilder) WithAsis(asis bool) *StoreValueCommandBuilder
WithAsis sets the asis option Please note, this is an advanced feature, only use with caution
func (*StoreValueCommandBuilder) WithBucket ¶
func (builder *StoreValueCommandBuilder) WithBucket(bucket string) *StoreValueCommandBuilder
WithBucket sets the bucket to be used by the command
func (*StoreValueCommandBuilder) WithBucketType ¶
func (builder *StoreValueCommandBuilder) WithBucketType(bucketType string) *StoreValueCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*StoreValueCommandBuilder) WithConflictResolver ¶
func (builder *StoreValueCommandBuilder) WithConflictResolver(resolver ConflictResolver) *StoreValueCommandBuilder
WithConflictResolver sets the ConflictResolver that should be used when sibling conflicts are found for this operation
func (*StoreValueCommandBuilder) WithContent ¶
func (builder *StoreValueCommandBuilder) WithContent(object *Object) *StoreValueCommandBuilder
WithContent sets the object / value to be stored at the specified key
func (*StoreValueCommandBuilder) WithDw ¶
func (builder *StoreValueCommandBuilder) WithDw(dw uint32) *StoreValueCommandBuilder
WithDw (durable writes) sets the number of nodes that must report back a successful write to backend storage in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreValueCommandBuilder) WithIfNoneMatch ¶
func (builder *StoreValueCommandBuilder) WithIfNoneMatch(ifNoneMatch bool) *StoreValueCommandBuilder
WithIfNoneMatch tells Riak to store the object only if it does not already exist in the database
func (*StoreValueCommandBuilder) WithIfNotModified ¶
func (builder *StoreValueCommandBuilder) WithIfNotModified(ifNotModified bool) *StoreValueCommandBuilder
WithIfNotModified tells Riak to only update the object in Riak if the vclock provided matches the one currently in Riak
func (*StoreValueCommandBuilder) WithKey ¶
func (builder *StoreValueCommandBuilder) WithKey(key string) *StoreValueCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*StoreValueCommandBuilder) WithNVal ¶
func (builder *StoreValueCommandBuilder) WithNVal(nval uint32) *StoreValueCommandBuilder
WithNVal sets the number of times this command operation is replicated in the Cluster. If ommitted, the ring default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreValueCommandBuilder) WithPw ¶
func (builder *StoreValueCommandBuilder) WithPw(pw uint32) *StoreValueCommandBuilder
WithPw sets the number of primary nodes (N) that must report back a successful write in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreValueCommandBuilder) WithReturnBody ¶
func (builder *StoreValueCommandBuilder) WithReturnBody(returnBody bool) *StoreValueCommandBuilder
WithReturnBody sets Riak to return the value within its response after completing the write operation
func (*StoreValueCommandBuilder) WithReturnHead ¶
func (builder *StoreValueCommandBuilder) WithReturnHead(returnHead bool) *StoreValueCommandBuilder
WithReturnHead returns only the meta data for the value, useful when objects contain large amounts of data
func (*StoreValueCommandBuilder) WithSloppyQuorum ¶
func (builder *StoreValueCommandBuilder) WithSloppyQuorum(sloppyQuorum bool) *StoreValueCommandBuilder
WithSloppyQuorum sets the sloppy_quorum for this Command Please note, this is an advanced feature, only use with caution
See http://docs.basho.com/riak/latest/theory/concepts/Eventual-Consistency/
func (*StoreValueCommandBuilder) WithTimeout ¶
func (builder *StoreValueCommandBuilder) WithTimeout(timeout time.Duration) *StoreValueCommandBuilder
WithTimeout sets a timeout to be used for this command operation
func (*StoreValueCommandBuilder) WithVClock ¶
func (builder *StoreValueCommandBuilder) WithVClock(vclock []byte) *StoreValueCommandBuilder
WithVClock sets the vclock for the object to be stored, providing causal context for conflicts
func (*StoreValueCommandBuilder) WithW ¶
func (builder *StoreValueCommandBuilder) WithW(w uint32) *StoreValueCommandBuilder
WithW sets the number of nodes that must report back a successful write in order for then command operation to be considered a success by Riak
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
type StoreValueResponse ¶
StoreValueResponse contains the response data for a StoreValueCommand
type TsCell ¶ added in v1.7.0
type TsCell struct {
// contains filtered or unexported fields
}
TsCell represents a cell value within a time series row
func NewBooleanTsCell ¶ added in v1.7.0
NewBooleanTsCell creates a TsCell from a boolean
func NewDoubleTsCell ¶ added in v1.7.0
NewDoubleTsCell creates a TsCell from an floating point number
func NewSint64TsCell ¶ added in v1.7.0
NewSint64TsCell creates a TsCell from an integer
func NewStringTsCell ¶ added in v1.7.0
NewStringTsCell creates a TsCell from a string
func NewTimestampTsCell ¶ added in v1.7.0
NewTimestampTsCell creates a TsCell from a time.Time struct
func NewTimestampTsCellFromInt64 ¶ added in v1.7.0
NewTimestampTsCellFromInt64 creates a TsCell from an int64 value that represents *milliseconds* since UTC epoch
func (*TsCell) GetBooleanValue ¶ added in v1.7.0
GetBooleanValue returns the boolean value stored within the cell
func (*TsCell) GetDataType ¶ added in v1.7.0
GetDataType returns the data type of the value stored within the cell
func (*TsCell) GetDoubleValue ¶ added in v1.7.0
GetDoubleValue returns the double value stored within the cell
func (*TsCell) GetSint64Value ¶ added in v1.7.0
GetSint64Value returns the sint64 value stored within the cell
func (*TsCell) GetStringValue ¶ added in v1.7.0
GetStringValue returns the string value stored within the cell
func (*TsCell) GetTimeValue ¶ added in v1.7.0
GetTimeValue returns the timestamp value stored within the cell as a time.Time
func (*TsCell) GetTimestampValue ¶ added in v1.7.0
GetTimestampValue returns the timestamp value stored within the cell
type TsColumnDescription ¶ added in v1.7.0
type TsColumnDescription struct {
// contains filtered or unexported fields
}
TsColumnDescription describes a Time Series column
func (*TsColumnDescription) GetName ¶ added in v1.7.0
func (c *TsColumnDescription) GetName() string
GetName returns the name for the column
func (*TsColumnDescription) GetType ¶ added in v1.7.0
func (c *TsColumnDescription) GetType() string
GetType returns the data type for the column
type TsDeleteRowCommand ¶ added in v1.7.0
type TsDeleteRowCommand struct { Response bool // contains filtered or unexported fields }
TsDeleteRowCommand is used to delete a value from Riak TS
func (*TsDeleteRowCommand) Name ¶ added in v1.7.0
func (cmd *TsDeleteRowCommand) Name() string
Name identifies this command
type TsDeleteRowCommandBuilder ¶ added in v1.7.0
type TsDeleteRowCommandBuilder struct {
// contains filtered or unexported fields
}
TsDeleteRowCommandBuilder type is required for creating new instances of TsDeleteRowCommand
cmd, err := NewTsDeleteRowCommandBuilder(). WithTable("myTable"). WithKey(key). Build()
func NewTsDeleteRowCommandBuilder ¶ added in v1.7.0
func NewTsDeleteRowCommandBuilder() *TsDeleteRowCommandBuilder
NewTsDeleteRowCommandBuilder is a factory function for generating the command builder struct
func (*TsDeleteRowCommandBuilder) Build ¶ added in v1.7.0
func (builder *TsDeleteRowCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*TsDeleteRowCommandBuilder) WithKey ¶ added in v1.7.0
func (builder *TsDeleteRowCommandBuilder) WithKey(key []TsCell) *TsDeleteRowCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*TsDeleteRowCommandBuilder) WithTable ¶ added in v1.7.0
func (builder *TsDeleteRowCommandBuilder) WithTable(table string) *TsDeleteRowCommandBuilder
WithTable sets the table to be used by the command
func (*TsDeleteRowCommandBuilder) WithTimeout ¶ added in v1.7.0
func (builder *TsDeleteRowCommandBuilder) WithTimeout(timeout time.Duration) *TsDeleteRowCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
type TsFetchRowCommand ¶ added in v1.7.0
type TsFetchRowCommand struct { Response *TsFetchRowResponse // contains filtered or unexported fields }
TsFetchRowCommand is used to fetch / get a value from Riak KV
func (*TsFetchRowCommand) Name ¶ added in v1.7.0
func (cmd *TsFetchRowCommand) Name() string
Name identifies this command
type TsFetchRowCommandBuilder ¶ added in v1.7.0
type TsFetchRowCommandBuilder struct {
// contains filtered or unexported fields
}
TsFetchRowCommandBuilder type is required for creating new instances of TsFetchRowCommand
key := make([]riak.TsCell, 3) key[0] = NewStringTsCell("South Atlantic") key[1] = NewStringTsCell("South Carolina") key[2] = NewTimestampTsCell(1420113600) cmd, err := NewTsFetchRowCommandBuilder(). WithBucketType("myBucketType"). WithTable("myTable"). WithKey(key). Build()
func NewTsFetchRowCommandBuilder ¶ added in v1.7.0
func NewTsFetchRowCommandBuilder() *TsFetchRowCommandBuilder
NewTsFetchRowCommandBuilder is a factory function for generating the command builder struct
func (*TsFetchRowCommandBuilder) Build ¶ added in v1.7.0
func (builder *TsFetchRowCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*TsFetchRowCommandBuilder) WithKey ¶ added in v1.7.0
func (builder *TsFetchRowCommandBuilder) WithKey(key []TsCell) *TsFetchRowCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*TsFetchRowCommandBuilder) WithTable ¶ added in v1.7.0
func (builder *TsFetchRowCommandBuilder) WithTable(table string) *TsFetchRowCommandBuilder
WithTable sets the table to be used by the command
func (*TsFetchRowCommandBuilder) WithTimeout ¶ added in v1.7.0
func (builder *TsFetchRowCommandBuilder) WithTimeout(timeout time.Duration) *TsFetchRowCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
type TsFetchRowResponse ¶ added in v1.7.0
type TsFetchRowResponse struct { IsNotFound bool Columns []TsColumnDescription Row []TsCell }
TsFetchRowResponse contains the response data for a TsFetchRowCommand
type TsListKeysCommand ¶ added in v1.7.0
type TsListKeysCommand struct { Response *TsListKeysResponse // contains filtered or unexported fields }
TsListKeysCommand is used to fetch values from a table in Riak TS
func (*TsListKeysCommand) Name ¶ added in v1.7.0
func (cmd *TsListKeysCommand) Name() string
Name identifies this command
type TsListKeysCommandBuilder ¶ added in v1.7.0
type TsListKeysCommandBuilder struct {
// contains filtered or unexported fields
}
TsListKeysCommandBuilder type is required for creating new instances of TsListKeysCommand
cmd, err := NewTsListKeysCommandBuilder(). WithTable("myTable"). WithStreaming(true). WithCallback(cb). Build()
func NewTsListKeysCommandBuilder ¶ added in v1.7.0
func NewTsListKeysCommandBuilder() *TsListKeysCommandBuilder
NewTsListKeysCommandBuilder is a factory function for generating the command builder struct
func (*TsListKeysCommandBuilder) Build ¶ added in v1.7.0
func (builder *TsListKeysCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*TsListKeysCommandBuilder) WithCallback ¶ added in v1.7.0
func (builder *TsListKeysCommandBuilder) WithCallback(callback func([][]TsCell) error) *TsListKeysCommandBuilder
WithCallback sets the callback to be used when handling a streaming response
Requires WithStreaming(true)
func (*TsListKeysCommandBuilder) WithStreaming ¶ added in v1.7.0
func (builder *TsListKeysCommandBuilder) WithStreaming(streaming bool) *TsListKeysCommandBuilder
WithStreaming sets the command to provide a streamed response
If true, a callback must be provided via WithCallback()
func (*TsListKeysCommandBuilder) WithTable ¶ added in v1.7.0
func (builder *TsListKeysCommandBuilder) WithTable(table string) *TsListKeysCommandBuilder
WithTable sets the table to be used by the command
func (*TsListKeysCommandBuilder) WithTimeout ¶ added in v1.7.0
func (builder *TsListKeysCommandBuilder) WithTimeout(timeout time.Duration) *TsListKeysCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
type TsListKeysResponse ¶ added in v1.7.0
type TsListKeysResponse struct {
Keys [][]TsCell
}
TsListKeysResponse contains the response data for a TsListKeysCommand
type TsQueryCommand ¶ added in v1.7.0
type TsQueryCommand struct { Response *TsQueryResponse // contains filtered or unexported fields }
TsQueryCommand is used to fetch / get a value from Riak TS
func (*TsQueryCommand) Name ¶ added in v1.7.0
func (cmd *TsQueryCommand) Name() string
Name identifies this command
type TsQueryCommandBuilder ¶ added in v1.7.0
type TsQueryCommandBuilder struct {
// contains filtered or unexported fields
}
TsQueryCommandBuilder type is required for creating new instances of TsQueryCommand
cmd, err := NewTsQueryCommandBuilder(). WithQuery("select * from GeoCheckin where time > 1234560 and time < 1234569 and region = 'South Atlantic'"). WithStreaming(true). WithCallback(cb). Build()
func NewTsQueryCommandBuilder ¶ added in v1.7.0
func NewTsQueryCommandBuilder() *TsQueryCommandBuilder
NewTsQueryCommandBuilder is a factory function for generating the command builder struct
func (*TsQueryCommandBuilder) Build ¶ added in v1.7.0
func (builder *TsQueryCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*TsQueryCommandBuilder) WithCallback ¶ added in v1.7.0
func (builder *TsQueryCommandBuilder) WithCallback(callback func([][]TsCell) error) *TsQueryCommandBuilder
WithCallback sets the callback to be used when handling a streaming response
Requires WithStreaming(true)
func (*TsQueryCommandBuilder) WithQuery ¶ added in v1.7.0
func (builder *TsQueryCommandBuilder) WithQuery(query string) *TsQueryCommandBuilder
WithQuery sets the query to be used by the command
func (*TsQueryCommandBuilder) WithStreaming ¶ added in v1.7.0
func (builder *TsQueryCommandBuilder) WithStreaming(streaming bool) *TsQueryCommandBuilder
WithStreaming sets the command to provide a streamed response
If true, a callback must be provided via WithCallback()
type TsQueryResponse ¶ added in v1.7.0
type TsQueryResponse struct { Columns []TsColumnDescription Rows [][]TsCell }
TsQueryResponse contains the response data for a TsQueryCommand
type TsStoreRowsCommand ¶ added in v1.7.0
type TsStoreRowsCommand struct { Response bool // contains filtered or unexported fields }
TsStoreRowsCommand is sused to store a new row/s in Riak TS
func (*TsStoreRowsCommand) Name ¶ added in v1.7.0
func (cmd *TsStoreRowsCommand) Name() string
Name identifies this command
type TsStoreRowsCommandBuilder ¶ added in v1.7.0
type TsStoreRowsCommandBuilder struct {
// contains filtered or unexported fields
}
TsStoreRowsCommandBuilder type is required for creating new instances of StoreIndexCommand
cmd, err := NewTsStoreRowsCommandBuilder(). WithTable("myTableName"). WithRows(rows). Build()
func NewTsStoreRowsCommandBuilder ¶ added in v1.7.0
func NewTsStoreRowsCommandBuilder() *TsStoreRowsCommandBuilder
NewTsStoreRowsCommandBuilder is a factory function for generating the command builder struct
func (*TsStoreRowsCommandBuilder) Build ¶ added in v1.7.0
func (builder *TsStoreRowsCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*TsStoreRowsCommandBuilder) WithRows ¶ added in v1.7.0
func (builder *TsStoreRowsCommandBuilder) WithRows(rows [][]TsCell) *TsStoreRowsCommandBuilder
WithRows sets the rows to be stored by the command
func (*TsStoreRowsCommandBuilder) WithTable ¶ added in v1.7.0
func (builder *TsStoreRowsCommandBuilder) WithTable(table string) *TsStoreRowsCommandBuilder
WithTable sets the table to use for the command
type UpdateCounterCommand ¶
type UpdateCounterCommand struct { Response *UpdateCounterResponse // contains filtered or unexported fields }
UpdateCounterCommand is used to increment or decrement a counter data type in Riak KV
func (*UpdateCounterCommand) Name ¶
func (cmd *UpdateCounterCommand) Name() string
Name identifies this command
type UpdateCounterCommandBuilder ¶
type UpdateCounterCommandBuilder struct {
// contains filtered or unexported fields
}
UpdateCounterCommandBuilder type is required for creating new instances of UpdateCounterCommand
command := NewUpdateCounterCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithKey("myKey"). WithIncrement(1). Build()
func NewUpdateCounterCommandBuilder ¶
func NewUpdateCounterCommandBuilder() *UpdateCounterCommandBuilder
NewUpdateCounterCommandBuilder is a factory function for generating the command builder struct
func (*UpdateCounterCommandBuilder) Build ¶
func (builder *UpdateCounterCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*UpdateCounterCommandBuilder) WithBucket ¶
func (builder *UpdateCounterCommandBuilder) WithBucket(bucket string) *UpdateCounterCommandBuilder
WithBucket sets the bucket to be used by the command
func (*UpdateCounterCommandBuilder) WithBucketType ¶
func (builder *UpdateCounterCommandBuilder) WithBucketType(bucketType string) *UpdateCounterCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*UpdateCounterCommandBuilder) WithDw ¶
func (builder *UpdateCounterCommandBuilder) WithDw(dw uint32) *UpdateCounterCommandBuilder
WithDw (durable writes) sets the number of nodes that must report back a successful write to backend storage in order for the command operation to be considered a success by Riak
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*UpdateCounterCommandBuilder) WithIncrement ¶
func (builder *UpdateCounterCommandBuilder) WithIncrement(increment int64) *UpdateCounterCommandBuilder
WithIncrement defines the increment the Counter value is to be increased / decreased by
func (*UpdateCounterCommandBuilder) WithKey ¶
func (builder *UpdateCounterCommandBuilder) WithKey(key string) *UpdateCounterCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*UpdateCounterCommandBuilder) WithPw ¶
func (builder *UpdateCounterCommandBuilder) WithPw(pw uint32) *UpdateCounterCommandBuilder
WithPw sets the number of primary nodes (N) that must report back a successful write in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*UpdateCounterCommandBuilder) WithReturnBody ¶
func (builder *UpdateCounterCommandBuilder) WithReturnBody(returnBody bool) *UpdateCounterCommandBuilder
WithReturnBody sets Riak to return the value within its response after completing the write operation
func (*UpdateCounterCommandBuilder) WithTimeout ¶
func (builder *UpdateCounterCommandBuilder) WithTimeout(timeout time.Duration) *UpdateCounterCommandBuilder
WithTimeout sets a timeout to be used for this command operation
func (*UpdateCounterCommandBuilder) WithW ¶
func (builder *UpdateCounterCommandBuilder) WithW(w uint32) *UpdateCounterCommandBuilder
WithW sets the number of nodes that must report back a successful write in order for then command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
type UpdateCounterResponse ¶
UpdateCounterResponse is the object containing the response
type UpdateMapCommand ¶
type UpdateMapCommand struct { Response *UpdateMapResponse // contains filtered or unexported fields }
UpdateMapCommand updates a map CRDT in Riak
func (*UpdateMapCommand) Name ¶
func (cmd *UpdateMapCommand) Name() string
Name identifies this command
type UpdateMapCommandBuilder ¶
type UpdateMapCommandBuilder struct {
// contains filtered or unexported fields
}
UpdateMapCommandBuilder type is required for creating new instances of UpdateMapCommand
mapOp := &MapOperation{} mapOp.SetRegister("register_1", []byte("register_value_1")) command := NewUpdateMapCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithKey("myKey"). WithMapOperation(mapOp). Build()
func NewUpdateMapCommandBuilder ¶
func NewUpdateMapCommandBuilder() *UpdateMapCommandBuilder
NewUpdateMapCommandBuilder is a factory function for generating the command builder struct
func (*UpdateMapCommandBuilder) Build ¶
func (builder *UpdateMapCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*UpdateMapCommandBuilder) WithBucket ¶
func (builder *UpdateMapCommandBuilder) WithBucket(bucket string) *UpdateMapCommandBuilder
WithBucket sets the bucket to be used by the command
func (*UpdateMapCommandBuilder) WithBucketType ¶
func (builder *UpdateMapCommandBuilder) WithBucketType(bucketType string) *UpdateMapCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*UpdateMapCommandBuilder) WithContext ¶
func (builder *UpdateMapCommandBuilder) WithContext(context []byte) *UpdateMapCommandBuilder
WithContext sets the causal context needed to identify the state of the map when removing elements
func (*UpdateMapCommandBuilder) WithDw ¶
func (builder *UpdateMapCommandBuilder) WithDw(dw uint32) *UpdateMapCommandBuilder
WithDw (durable writes) sets the number of nodes that must report back a successful write to backend storage in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*UpdateMapCommandBuilder) WithKey ¶
func (builder *UpdateMapCommandBuilder) WithKey(key string) *UpdateMapCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*UpdateMapCommandBuilder) WithMapOperation ¶
func (builder *UpdateMapCommandBuilder) WithMapOperation(mapOperation *MapOperation) *UpdateMapCommandBuilder
WithMapOperation provides the details of what is supposed to be updated on the map
func (*UpdateMapCommandBuilder) WithPw ¶
func (builder *UpdateMapCommandBuilder) WithPw(pw uint32) *UpdateMapCommandBuilder
WithPw sets the number of primary nodes (N) that must report back a successful write in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*UpdateMapCommandBuilder) WithReturnBody ¶
func (builder *UpdateMapCommandBuilder) WithReturnBody(returnBody bool) *UpdateMapCommandBuilder
WithReturnBody sets Riak to return the value within its response after completing the write operation
func (*UpdateMapCommandBuilder) WithTimeout ¶
func (builder *UpdateMapCommandBuilder) WithTimeout(timeout time.Duration) *UpdateMapCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
func (*UpdateMapCommandBuilder) WithW ¶
func (builder *UpdateMapCommandBuilder) WithW(w uint32) *UpdateMapCommandBuilder
WithW sets the number of nodes that must report back a successful write in order for then command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
type UpdateMapResponse ¶
UpdateMapResponse contains the response data for a UpdateMapCommand
type UpdateSetCommand ¶
type UpdateSetCommand struct { Response *UpdateSetResponse // contains filtered or unexported fields }
UpdateSetCommand stores or updates a set CRDT in Riak
func (*UpdateSetCommand) Name ¶
func (cmd *UpdateSetCommand) Name() string
Name identifies this command
type UpdateSetCommandBuilder ¶
type UpdateSetCommandBuilder struct {
// contains filtered or unexported fields
}
UpdateSetCommandBuilder type is required for creating new instances of UpdateSetCommand
adds := [][]byte{ []byte("a1"), []byte("a2"), []byte("a3"), []byte("a4"), } command := NewUpdateSetCommandBuilder(). WithBucketType("myBucketType"). WithBucket("myBucket"). WithKey("myKey"). WithContext(setContext). WithAdditions(adds). Build()
func NewUpdateSetCommandBuilder ¶
func NewUpdateSetCommandBuilder() *UpdateSetCommandBuilder
NewUpdateSetCommandBuilder is a factory function for generating the command builder struct
func (*UpdateSetCommandBuilder) Build ¶
func (builder *UpdateSetCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
func (*UpdateSetCommandBuilder) WithAdditions ¶
func (builder *UpdateSetCommandBuilder) WithAdditions(adds ...[]byte) *UpdateSetCommandBuilder
WithAdditions sets the set elements to be added to the CRDT set via this update operation
func (*UpdateSetCommandBuilder) WithBucket ¶
func (builder *UpdateSetCommandBuilder) WithBucket(bucket string) *UpdateSetCommandBuilder
WithBucket sets the bucket to be used by the command
func (*UpdateSetCommandBuilder) WithBucketType ¶
func (builder *UpdateSetCommandBuilder) WithBucketType(bucketType string) *UpdateSetCommandBuilder
WithBucketType sets the bucket-type to be used by the command. If omitted, 'default' is used
func (*UpdateSetCommandBuilder) WithContext ¶
func (builder *UpdateSetCommandBuilder) WithContext(context []byte) *UpdateSetCommandBuilder
WithContext sets the causal context needed to identify the state of the set when removing elements
func (*UpdateSetCommandBuilder) WithDw ¶
func (builder *UpdateSetCommandBuilder) WithDw(dw uint32) *UpdateSetCommandBuilder
WithDw (durable writes) sets the number of nodes that must report back a successful write to backend storage in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*UpdateSetCommandBuilder) WithKey ¶
func (builder *UpdateSetCommandBuilder) WithKey(key string) *UpdateSetCommandBuilder
WithKey sets the key to be used by the command to read / write values
func (*UpdateSetCommandBuilder) WithPw ¶
func (builder *UpdateSetCommandBuilder) WithPw(pw uint32) *UpdateSetCommandBuilder
WithPw sets the number of primary nodes (N) that must report back a successful write in order for the command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*UpdateSetCommandBuilder) WithRemovals ¶
func (builder *UpdateSetCommandBuilder) WithRemovals(removals ...[]byte) *UpdateSetCommandBuilder
WithRemovals sets the set elements to be removed from the CRDT set via this update operation
func (*UpdateSetCommandBuilder) WithReturnBody ¶
func (builder *UpdateSetCommandBuilder) WithReturnBody(returnBody bool) *UpdateSetCommandBuilder
WithReturnBody sets Riak to return the value within its response after completing the write operation
func (*UpdateSetCommandBuilder) WithTimeout ¶
func (builder *UpdateSetCommandBuilder) WithTimeout(timeout time.Duration) *UpdateSetCommandBuilder
WithTimeout sets a timeout to be used for this command operation
func (*UpdateSetCommandBuilder) WithW ¶
func (builder *UpdateSetCommandBuilder) WithW(w uint32) *UpdateSetCommandBuilder
WithW sets the number of nodes that must report back a successful write in order for then command operation to be considered a success by Riak. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
type UpdateSetResponse ¶
UpdateSetResponse contains the response data for a UpdateSetCommand
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
rpb
|
|
riak
Package riak is a generated protocol buffer package.
|
Package riak is a generated protocol buffer package. |
riak_dt
Package riak_dt is a generated protocol buffer package.
|
Package riak_dt is a generated protocol buffer package. |
riak_kv
Package riak_kv is a generated protocol buffer package.
|
Package riak_kv is a generated protocol buffer package. |
riak_search
Package riak_search is a generated protocol buffer package.
|
Package riak_search is a generated protocol buffer package. |
riak_ts
Package riak_ts is a generated protocol buffer package.
|
Package riak_ts is a generated protocol buffer package. |
riak_yokozuna
Package riak_yokozuna is a generated protocol buffer package.
|
Package riak_yokozuna is a generated protocol buffer package. |