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"
riak "github.com/basho/riak-go-client"
)
func main() {
nodeOpts := &riak.NodeOptions{
RemoteAddress: "127.0.0.1:8098",
}
var node *riak.Node
var err error
if node, err = riak.NewNode(nodeOpts); err != nil {
fmt.Println(err.Error())
}
nodes := []*riak.Node{node}
opts := &riak.ClusterOptions{
Nodes: nodes,
}
cluster, err := riak.NewCluster(opts)
if err != nil {
fmt.Println(err.Error())
}
defer func() {
if err := cluster.Stop(); err != nil {
fmt.Println(err.Error())
}
}()
if err := cluster.Start(); err != nil {
fmt.Println(err.Error())
}
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())
}
if err := cluster.Execute(cmd); err != nil {
fmt.Println(err.Error())
}
svc := cmd.(*StoreValueCommand)
rsp := svc.Response
fmt.Println(rsp.GeneratedKey)
}
Index ¶
- Variables
- type AuthCommand
- type AuthOptions
- type Client
- type Cluster
- type ClusterOptions
- type Command
- type CommandBuilder
- type CommandImpl
- 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 Error
- type FetchBucketPropsCommand
- type FetchBucketPropsCommandBuilder
- type FetchBucketPropsResponse
- 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) WithIfNotModified(ifNotModified []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 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 Node
- type NodeManager
- type NodeOptions
- type Object
- type Pair
- type PingCommand
- type PingCommandBuilder
- type PreflistItem
- type ReplMode
- 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) 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 StartTlsCommand
- 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 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 StreamingCommand
- 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 ¶
This section is empty.
Variables ¶
var ( ErrAddressRequired = errors.New("RemoteAddress is required in options") ErrAuthMissingConfig = errors.New("[Connection] authentication is missing TLS config") ErrAuthTLSUpgradeFailed = errors.New("[Connection] upgrading to TLS connection failed") ErrBucketRequired = errors.New("Bucket is required") ErrCannotRead = errors.New("Cannot read from a non-active or closed connection") ErrCannotWrite = errors.New("Cannot write to a non-active or closed connection") ErrExpectedResponse = errors.New("Expected a response from Riak but did not receive one") ErrKeyRequired = errors.New("Key is required") ErrNilOptions = errors.New("[Command] options must be non-nil") ErrOptionsRequired = errors.New("Options are required") )
Convenience variables used to generate errors throughout the library
var EnableDebugLogging = false
If true, debug messages will be written to the log
var ErrZeroLength error = errors.New("[Command] 0 byte data response")
Functions ¶
This section is empty.
Types ¶
type AuthCommand ¶
type AuthCommand struct {
CommandImpl
User string
Password string
}
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 active connection to Riak and the debug flag
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster object contains your pool of Node objects, the NodeManager and the current stateData object of the cluster
func NewCluster ¶
func NewCluster(options *ClusterOptions) (c *Cluster, err 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 the provided Command against the active pooled Nodes using the NodeManager
func (*Cluster) Start ¶
Start opens connections with your configured nodes and adds them to the active pool
type ClusterOptions ¶
type ClusterOptions struct {
Nodes []*Node
NodeManager NodeManager
}
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
Successful() bool
// 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 CommandImpl ¶
func (*CommandImpl) Successful ¶
func (cmd *CommandImpl) Successful() bool
type CommitHook ¶
type ConflictResolver ¶
ConflictResolver is an interface to handle sibling conflicts for a key
type DeleteIndexCommand ¶
type DeleteIndexCommand struct {
CommandImpl
Response bool
// contains filtered or unexported fields
}
func (*DeleteIndexCommand) Name ¶
func (cmd *DeleteIndexCommand) Name() string
Name identifies this command
type DeleteIndexCommandBuilder ¶
type DeleteIndexCommandBuilder struct {
// contains filtered or unexported fields
}
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 {
CommandImpl
Response bool
// contains filtered or unexported fields
}
Command 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
Set the RW value.
This represents the quorum for both get and put operations involved in deleting an object .
func (*DeleteValueCommandBuilder) WithTimeout ¶
func (builder *DeleteValueCommandBuilder) WithTimeout(timeout time.Duration) *DeleteValueCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
func (*DeleteValueCommandBuilder) WithVClock ¶
func (builder *DeleteValueCommandBuilder) WithVClock(vclock []byte) *DeleteValueCommandBuilder
Set 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 {
CommandImpl
Response *FetchBucketPropsResponse
// contains filtered or unexported fields
}
func (*FetchBucketPropsCommand) Name ¶
func (cmd *FetchBucketPropsCommand) Name() string
Name identifies this command
type FetchBucketPropsCommandBuilder ¶
type FetchBucketPropsCommandBuilder struct {
// contains filtered or unexported fields
}
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
}
type FetchCounterCommand ¶
type FetchCounterCommand struct {
CommandImpl
Response *FetchCounterResponse
// contains filtered or unexported fields
}
func (*FetchCounterCommand) Name ¶
func (cmd *FetchCounterCommand) Name() string
Name identifies this command
type FetchCounterCommandBuilder ¶
type FetchCounterCommandBuilder struct {
// contains filtered or unexported fields
}
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
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
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 in milliseconds to be used for this command operation
type FetchCounterResponse ¶
type FetchIndexCommand ¶
type FetchIndexCommand struct {
CommandImpl
Response []*SearchIndex
// contains filtered or unexported fields
}
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 {
CommandImpl
Response *FetchMapResponse
// contains filtered or unexported fields
}
func (*FetchMapCommand) Name ¶
func (cmd *FetchMapCommand) Name() string
Name identifies this command
type FetchMapCommandBuilder ¶
type FetchMapCommandBuilder struct {
// contains filtered or unexported fields
}
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
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
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 ¶
type FetchPreflistCommand ¶
type FetchPreflistCommand struct {
CommandImpl
Response *FetchPreflistResponse
// contains filtered or unexported fields
}
Command 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
}
type FetchSchemaCommand ¶
type FetchSchemaCommand struct {
CommandImpl
Response *Schema
// contains filtered or unexported fields
}
func (*FetchSchemaCommand) Name ¶
func (cmd *FetchSchemaCommand) Name() string
Name identifies this command
type FetchSchemaCommandBuilder ¶
type FetchSchemaCommandBuilder struct {
// contains filtered or unexported fields
}
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
type FetchSetCommand ¶
type FetchSetCommand struct {
CommandImpl
Response *FetchSetResponse
// contains filtered or unexported fields
}
func (*FetchSetCommand) Name ¶
func (cmd *FetchSetCommand) Name() string
Name identifies this command
type FetchSetCommandBuilder ¶
type FetchSetCommandBuilder struct {
// contains filtered or unexported fields
}
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
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
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 in milliseconds to be used for this command operation
type FetchSetResponse ¶
type FetchValueCommand ¶
type FetchValueCommand struct {
CommandImpl
Response *FetchValueResponse
// contains filtered or unexported fields
}
FetchValueCommand is used to fetch / get a value from Riak
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
Example ¶
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
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
func (*FetchValueCommandBuilder) WithIfNotModified ¶
func (builder *FetchValueCommandBuilder) WithIfNotModified(ifNotModified []byte) *FetchValueCommandBuilder
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
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
func (*FetchValueCommandBuilder) WithSloppyQuorum ¶
func (builder *FetchValueCommandBuilder) WithSloppyQuorum(sloppyQuorum bool) *FetchValueCommandBuilder
func (*FetchValueCommandBuilder) WithTimeout ¶
func (builder *FetchValueCommandBuilder) WithTimeout(timeout time.Duration) *FetchValueCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
type FetchValueResponse ¶
FetchValueResponse contains the response data for a FetchValueCommand
type ListBucketsCommand ¶
type ListBucketsCommand struct {
CommandImpl
Response *ListBucketsResponse
// contains filtered or unexported fields
}
Command used to list buckets in a bucket type.
func (*ListBucketsCommand) Done ¶
func (cmd *ListBucketsCommand) Done() bool
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 buckets
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
Callback to use when streaming responses.
func (*ListBucketsCommandBuilder) WithStreaming ¶
func (builder *ListBucketsCommandBuilder) WithStreaming(streaming bool) *ListBucketsCommandBuilder
Set to stream responses.
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
}
type ListKeysCommand ¶
type ListKeysCommand struct {
CommandImpl
Response *ListKeysResponse
// contains filtered or unexported fields
}
Command used to fetch a list of keys from Riak KV.
func (*ListKeysCommand) Done ¶
func (cmd *ListKeysCommand) Done() bool
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(keys []string) error {
// Do something with keys
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
func (*ListKeysCommandBuilder) WithStreaming ¶
func (builder *ListKeysCommandBuilder) WithStreaming(streaming bool) *ListKeysCommandBuilder
func (*ListKeysCommandBuilder) WithTimeout ¶
func (builder *ListKeysCommandBuilder) WithTimeout(timeout time.Duration) *ListKeysCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
type ListKeysResponse ¶
type ListKeysResponse struct {
Keys []string
}
type MapOperation ¶
type MapOperation struct {
// contains filtered or unexported fields
}
func (*MapOperation) AddToSet ¶
func (mapOp *MapOperation) AddToSet(key string, value []byte) *MapOperation
func (*MapOperation) IncrementCounter ¶
func (mapOp *MapOperation) IncrementCounter(key string, increment int64) *MapOperation
func (*MapOperation) Map ¶
func (mapOp *MapOperation) Map(key string) *MapOperation
func (*MapOperation) RemoveCounter ¶
func (mapOp *MapOperation) RemoveCounter(key string) *MapOperation
func (*MapOperation) RemoveFlag ¶
func (mapOp *MapOperation) RemoveFlag(key string) *MapOperation
func (*MapOperation) RemoveFromSet ¶
func (mapOp *MapOperation) RemoveFromSet(key string, value []byte) *MapOperation
func (*MapOperation) RemoveMap ¶
func (mapOp *MapOperation) RemoveMap(key string) *MapOperation
func (*MapOperation) RemoveRegister ¶
func (mapOp *MapOperation) RemoveRegister(key string) *MapOperation
func (*MapOperation) RemoveSet ¶
func (mapOp *MapOperation) RemoveSet(key string) *MapOperation
func (*MapOperation) SetFlag ¶
func (mapOp *MapOperation) SetFlag(key string, value bool) *MapOperation
func (*MapOperation) SetRegister ¶
func (mapOp *MapOperation) SetRegister(key string, value []byte) *MapOperation
type MapReduceCommand ¶
type MapReduceCommand struct {
CommandImpl
Response [][]byte
// contains filtered or unexported fields
}
Command used to fetch keys or data from Riak KV using the MapReduce technique
func (*MapReduceCommand) Done ¶
func (cmd *MapReduceCommand) Done() bool
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
func (*MapReduceCommandBuilder) WithQuery ¶
func (builder *MapReduceCommandBuilder) WithQuery(query string) *MapReduceCommandBuilder
func (*MapReduceCommandBuilder) WithStreaming ¶
func (builder *MapReduceCommandBuilder) WithStreaming(streaming bool) *MapReduceCommandBuilder
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
func (*Node) Execute ¶
Execute retrieves an available connection from the pool and executes the Command operation against Riak
func (*Node) Start ¶
Start opens a connection with Riak at the configured remoteAddress and adds the connections to the active pool
type NodeManager ¶
type NodeManager interface {
ExecuteOnNode(nodes []*Node, command Command, previous *Node) (executed bool, err 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
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 // TODO int indexes vs string
Links []*Link
VClock []byte
}
func (*Object) AddToIndex ¶
func (*Object) AddToIntIndex ¶
func (*Object) HasIndexes ¶
func (*Object) HasUserMeta ¶
type PingCommand ¶
type PingCommand struct {
CommandImpl
}
type PingCommandBuilder ¶
type PingCommandBuilder struct {
}
func (*PingCommandBuilder) Build ¶
func (builder *PingCommandBuilder) Build() (Command, error)
Build validates the configuration options provided then builds the command
type PreflistItem ¶
type SearchCommand ¶
type SearchCommand struct {
CommandImpl
Response *SearchResponse
// contains filtered or unexported fields
}
type SearchCommandBuilder ¶
type SearchCommandBuilder struct {
// contains filtered or unexported fields
}
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
func (*SearchCommandBuilder) WithDefaultOperation ¶
func (builder *SearchCommandBuilder) WithDefaultOperation(op string) *SearchCommandBuilder
func (*SearchCommandBuilder) WithFilterQuery ¶
func (builder *SearchCommandBuilder) WithFilterQuery(filterQuery string) *SearchCommandBuilder
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
func (*SearchCommandBuilder) WithPresort ¶
func (builder *SearchCommandBuilder) WithPresort(presort string) *SearchCommandBuilder
func (*SearchCommandBuilder) WithQuery ¶
func (builder *SearchCommandBuilder) WithQuery(query string) *SearchCommandBuilder
func (*SearchCommandBuilder) WithReturnFields ¶
func (builder *SearchCommandBuilder) WithReturnFields(fields ...string) *SearchCommandBuilder
func (*SearchCommandBuilder) WithSortField ¶
func (builder *SearchCommandBuilder) WithSortField(sortField string) *SearchCommandBuilder
func (*SearchCommandBuilder) WithStart ¶
func (builder *SearchCommandBuilder) WithStart(start uint32) *SearchCommandBuilder
type SearchIndex ¶
type SearchResponse ¶
type SecondaryIndexQueryCommand ¶
type SecondaryIndexQueryCommand struct {
CommandImpl
Response *SecondaryIndexQueryResponse
// contains filtered or unexported fields
}
Command used to query for keys from Riak KV using secondary indexes
func (*SecondaryIndexQueryCommand) Done ¶
func (cmd *SecondaryIndexQueryCommand) Done() bool
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").
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
func (*SecondaryIndexQueryCommandBuilder) WithContinuation ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithContinuation(cont []byte) *SecondaryIndexQueryCommandBuilder
func (*SecondaryIndexQueryCommandBuilder) WithIndexKey ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithIndexKey(key string) *SecondaryIndexQueryCommandBuilder
func (*SecondaryIndexQueryCommandBuilder) WithIndexName ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithIndexName(indexName string) *SecondaryIndexQueryCommandBuilder
WithIndexName sets the index to use for the command
func (*SecondaryIndexQueryCommandBuilder) WithIntRange ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithIntRange(min int64, max int64) *SecondaryIndexQueryCommandBuilder
func (*SecondaryIndexQueryCommandBuilder) WithMaxResults ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithMaxResults(maxResults uint32) *SecondaryIndexQueryCommandBuilder
func (*SecondaryIndexQueryCommandBuilder) WithPaginationSort ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithPaginationSort(paginationSort bool) *SecondaryIndexQueryCommandBuilder
func (*SecondaryIndexQueryCommandBuilder) WithRange ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithRange(min string, max string) *SecondaryIndexQueryCommandBuilder
func (*SecondaryIndexQueryCommandBuilder) WithReturnKeyAndIndex ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithReturnKeyAndIndex(val bool) *SecondaryIndexQueryCommandBuilder
func (*SecondaryIndexQueryCommandBuilder) WithStreaming ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithStreaming(streaming bool) *SecondaryIndexQueryCommandBuilder
func (*SecondaryIndexQueryCommandBuilder) WithTermRegex ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithTermRegex(regex string) *SecondaryIndexQueryCommandBuilder
func (*SecondaryIndexQueryCommandBuilder) WithTimeout ¶
func (builder *SecondaryIndexQueryCommandBuilder) WithTimeout(timeout time.Duration) *SecondaryIndexQueryCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
type SecondaryIndexQueryResponse ¶
type SecondaryIndexQueryResponse struct {
Results []*SecondaryIndexQueryResult
Continuation []byte
}
type StartTlsCommand ¶
type StartTlsCommand struct {
CommandImpl
}
func (*StartTlsCommand) Name ¶
func (cmd *StartTlsCommand) Name() string
Name identifies this command
type StoreBucketPropsCommand ¶
type StoreBucketPropsCommand struct {
CommandImpl
// contains filtered or unexported fields
}
func (*StoreBucketPropsCommand) Name ¶
func (cmd *StoreBucketPropsCommand) Name() string
Name identifies this command
type StoreBucketPropsCommandBuilder ¶
type StoreBucketPropsCommandBuilder struct {
// contains filtered or unexported fields
}
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
func (*StoreBucketPropsCommandBuilder) AddPreCommit ¶
func (builder *StoreBucketPropsCommandBuilder) AddPreCommit(commitHook *CommitHook) *StoreBucketPropsCommandBuilder
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
func (*StoreBucketPropsCommandBuilder) WithBackend ¶
func (builder *StoreBucketPropsCommandBuilder) WithBackend(backend string) *StoreBucketPropsCommandBuilder
func (*StoreBucketPropsCommandBuilder) WithBasicQuorum ¶
func (builder *StoreBucketPropsCommandBuilder) WithBasicQuorum(basicQuorum bool) *StoreBucketPropsCommandBuilder
func (*StoreBucketPropsCommandBuilder) WithBigVClock ¶
func (builder *StoreBucketPropsCommandBuilder) WithBigVClock(bigVClock uint32) *StoreBucketPropsCommandBuilder
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
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 ommitted, 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
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 ommitted, 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
func (*StoreBucketPropsCommandBuilder) WithOldVClock ¶
func (builder *StoreBucketPropsCommandBuilder) WithOldVClock(oldVClock uint32) *StoreBucketPropsCommandBuilder
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. If ommitted, the bucket default is used.
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. If ommitted, the bucket default is used.
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. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketPropsCommandBuilder) WithRw ¶
func (builder *StoreBucketPropsCommandBuilder) WithRw(rw uint32) *StoreBucketPropsCommandBuilder
func (*StoreBucketPropsCommandBuilder) WithSearch ¶
func (builder *StoreBucketPropsCommandBuilder) WithSearch(search bool) *StoreBucketPropsCommandBuilder
func (*StoreBucketPropsCommandBuilder) WithSearchIndex ¶
func (builder *StoreBucketPropsCommandBuilder) WithSearchIndex(searchIndex string) *StoreBucketPropsCommandBuilder
func (*StoreBucketPropsCommandBuilder) WithSmallVClock ¶
func (builder *StoreBucketPropsCommandBuilder) WithSmallVClock(smallVClock uint32) *StoreBucketPropsCommandBuilder
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. If ommitted, the bucket default is used.
See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
func (*StoreBucketPropsCommandBuilder) WithYoungVClock ¶
func (builder *StoreBucketPropsCommandBuilder) WithYoungVClock(youngVClock uint32) *StoreBucketPropsCommandBuilder
type StoreIndexCommand ¶
type StoreIndexCommand struct {
CommandImpl
Response bool
// contains filtered or unexported fields
}
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
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 {
CommandImpl
Response bool
// contains filtered or unexported fields
}
func (*StoreSchemaCommand) Name ¶
func (cmd *StoreSchemaCommand) Name() string
Name identifies this command
type StoreSchemaCommandBuilder ¶
type StoreSchemaCommandBuilder struct {
// contains filtered or unexported fields
}
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
func (*StoreSchemaCommandBuilder) WithSchemaName ¶
func (builder *StoreSchemaCommandBuilder) WithSchemaName(schemaName string) *StoreSchemaCommandBuilder
type StoreValueCommand ¶
type StoreValueCommand struct {
CommandImpl
Response *StoreValueResponse
// contains filtered or unexported fields
}
Command 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
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
func (*StoreValueCommandBuilder) WithContent ¶
func (builder *StoreValueCommandBuilder) WithContent(object *Object) *StoreValueCommandBuilder
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
func (*StoreValueCommandBuilder) WithIfNotModified ¶
func (builder *StoreValueCommandBuilder) WithIfNotModified(ifNotModified bool) *StoreValueCommandBuilder
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
func (*StoreValueCommandBuilder) WithSloppyQuorum ¶
func (builder *StoreValueCommandBuilder) WithSloppyQuorum(sloppyQuorum bool) *StoreValueCommandBuilder
func (*StoreValueCommandBuilder) WithTimeout ¶
func (builder *StoreValueCommandBuilder) WithTimeout(timeout time.Duration) *StoreValueCommandBuilder
WithTimeout sets a timeout in milliseconds to be used for this command operation
func (*StoreValueCommandBuilder) WithVClock ¶
func (builder *StoreValueCommandBuilder) WithVClock(vclock []byte) *StoreValueCommandBuilder
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 ¶
type StreamingCommand ¶
type StreamingCommand interface {
Done() bool
}
StreamingCommand interface requires the Done() method for signaling the completion of a streamed response
type UpdateCounterCommand ¶
type UpdateCounterCommand struct {
CommandImpl
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
}
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 in milliseconds 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 {
CommandImpl
Response *UpdateMapResponse
// contains filtered or unexported fields
}
func (*UpdateMapCommand) Name ¶
func (cmd *UpdateMapCommand) Name() string
Name identifies this command
type UpdateMapCommandBuilder ¶
type UpdateMapCommandBuilder struct {
// contains filtered or unexported fields
}
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
func (*UpdateMapCommandBuilder) WithDw ¶
func (builder *UpdateMapCommandBuilder) WithDw(dw uint32) *UpdateMapCommandBuilder
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
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 ¶
type UpdateSetCommand ¶
type UpdateSetCommand struct {
CommandImpl
Response *UpdateSetResponse
// contains filtered or unexported fields
}
func (*UpdateSetCommand) Name ¶
func (cmd *UpdateSetCommand) Name() string
Name identifies this command
type UpdateSetCommandBuilder ¶
type UpdateSetCommandBuilder struct {
// contains filtered or unexported fields
}
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
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
func (*UpdateSetCommandBuilder) WithDw ¶
func (builder *UpdateSetCommandBuilder) WithDw(dw uint32) *UpdateSetCommandBuilder
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
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 in milliseconds 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 ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
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_yokozuna
Package riak_yokozuna is a generated protocol buffer package.
|
Package riak_yokozuna is a generated protocol buffer package. |