Categorygithub.com/basho/riak-go-client
modulepackage
1.7.0
Repository: https://github.com/basho/riak-go-client.git
Documentation: pkg.go.dev

# README

Riak Go Client

The Riak Go Client is a client which makes it easy to communicate with Riak, an open source, distributed database that focuses on high availability, horizontal scalability, and predictable latency. Both Riak and this code is maintained by Basho.

  1. Installation
  2. Documentation
  3. Contributing
  4. Roadmap
  5. License and Authors

Build Status

Build Status

Installation

go get github.com/basho/riak-go-client

Documentation

Contributing

Note: Please clone this repository in such a manner that submodules are also cloned:

git clone --recursive https://github.com/basho/riak-go-client

OR:

git clone https://github.com/basho/riak-go-client
git submodule init --update

This repository's maintainers are engineers at Basho and we welcome your contribution to the project! Review the details in CONTRIBUTING.md in order to give back to this project.

An honest disclaimer

Due to our obsession with stability and our rich ecosystem of users, community updates on this repo may take a little longer to review.

The most helpful way to contribute is by reporting your experience through issues. Issues may not be updated while we review internally, but they're still incredibly appreciated.

Thank you for being part of the community! We love you for it.

Roadmap

  • 1.0.0 - Full Riak 2 support with command queuing and retries.

License

The Riak Go Client is Open Source software released under the Apache 2.0 License. Please see the LICENSE file for full license details.

These excellent community projects inspired this client and parts of their code are in riak-go-client as well:

Authors

Contributors

Thank you to all of our contributors!

# Packages

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

# Functions

NewBooleanTsCell creates a TsCell from a boolean.
NewClient generates a new Client object using the provided options.
NewCluster generates a new Cluster object using the provided ClusterOptions object.
NewDeleteIndexCommandBuilder is a factory function for generating the command builder struct.
NewDeleteValueCommandBuilder is a factory function for generating the command builder struct.
NewDoubleTsCell creates a TsCell from an floating point number.
NewFetchBucketPropsCommandBuilder is a factory function for generating the command builder struct.
NewFetchBucketTypePropsCommandBuilder is a factory function for generating the command builder struct.
NewFetchCounterCommandBuilder is a factory function for generating the command builder struct.
NewFetchIndexCommandBuilder is a factory function for generating the command builder struct.
NewFetchMapCommandBuilder is a factory function for generating the command builder struct.
NewFetchPreflistCommandBuilder is a factory function for generating the command builder struct.
NewFetchSchemaCommandBuilder is a factory function for generating the command builder struct.
NewFetchSetCommandBuilder is a factory function for generating the command builder struct.
NewFetchValueCommandBuilder is a factory function for generating the command builder struct.
NewListBucketsCommandBuilder is a factory function for generating the command builder struct.
NewListKeysCommandBuilder is a factory function for generating the command builder struct.
NewMapReduceCommandBuilder is a factory function for generating the command builder struct.
NewNode is a factory function that takes a NodeOptions struct and returns a Node struct.
NewResetBucketCommandBuilder is a factory function for generating the command builder struct.
NewSearchCommandBuilder is a factory function for generating the command builder struct.
NewSecondaryIndexQueryCommandBuilder is a factory function for generating the command builder struct.
NewSint64TsCell creates a TsCell from an integer.
NewStoreBucketPropsCommandBuilder is a factory function for generating the command builder struct.
NewStoreBucketTypePropsCommandBuilder is a factory function for generating the command builder struct.
NewStoreIndexCommandBuilder is a factory function for generating the command builder struct.
NewStoreSchemaCommandBuilder is a factory function for generating the command builder struct.
NewStoreValueCommandBuilder is a factory function for generating the command builder struct.
NewStringTsCell creates a TsCell from a string.
NewTimestampTsCell creates a TsCell from a time.Time struct.
NewTimestampTsCellFromInt64 creates a TsCell from an int64 value that represents *milliseconds* since UTC epoch.
NewTsDeleteRowCommandBuilder is a factory function for generating the command builder struct.
NewTsFetchRowCommandBuilder is a factory function for generating the command builder struct.
NewTsListKeysCommandBuilder is a factory function for generating the command builder struct.
NewTsQueryCommandBuilder is a factory function for generating the command builder struct.
NewTsStoreRowsCommandBuilder is a factory function for generating the command builder struct.
NewUpdateCounterCommandBuilder is a factory function for generating the command builder struct.
NewUpdateMapCommandBuilder is a factory function for generating the command builder struct.
NewUpdateSetCommandBuilder is a factory function for generating the command builder struct.
ToUnixMillis converts a time.Time to Unix milliseconds since UTC epoch.

# Constants

No description provided by the author
No description provided by the author
Convenience constants for maintaining the replication mode.
Convenience constants for maintaining the replication mode.
Convenience constants for maintaining the replication mode.
Convenience constants for maintaining the replication mode.

# Variables

If true, debug messages will be written to the log.
Client errors.
Client errors.
Client errors.
Client errors.
Connection errors.
Connection errors.
No description provided by the author
No description provided by the author
Cluster errors.
Cluster errors.
Cluster errors.
Cluster errors.
Cluster errors.
Cluster errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Client errors.
Client errors.
Client errors.
Client errors.
Client errors.
Client errors.

# Structs

Async object is used to pass required arguments to execute a Command asynchronously.
AuthOptions object contains the authentication credentials and tls config.
Client object contains your cluster object.
No description provided by the author
Cluster object contains your pool of Node objects, the NodeManager and the current stateData object of the cluster.
ClusterOptions object contains your pool of Node objects and the NodeManager If the NodeManager is not defined, the defaultNodeManager is used.
CommitHook object is used when fetching or updating pre- or post- commit hook bucket properties on Riak.
DeleteIndexCommand is used to delete a search index from Riak.
DeleteIndexCommandBuilder type is required for creating new instances of DeleteIndexCommand command := NewDeleteIndexCommandBuilder().
DeleteValueCommand is used to delete a value from Riak KV.
DeleteValueCommandBuilder type is required for creating new instances of DeleteValueCommand deleteValue := NewDeleteValueCommandBuilder().
FetchBucketPropsCommand is used to fetch the active / non-default properties for a bucket.
FetchBucketPropsCommandBuilder type is required for creating new instances of FetchBucketPropsCommand command := NewFetchBucketPropsCommandBuilder().
FetchBucketPropsResponse contains the response data for both FetchBucketPropsCommand and FetchBucketTypePropsCommand.
FetchBucketTypePropsCommand is used to fetch the active / non-default properties for a bucket type.
FetchBucketTypePropsCommandBuilder type is required for creating new instances of FetchBucketTypePropsCommand command := NewFetchBucketTypePropsCommandBuilder().
FetchCounterCommand fetches a counter CRDT from Riak.
FetchCounterCommandBuilder type is required for creating new instances of FetchCounterCommand command := NewFetchCounterCommandBuilder().
FetchCounterResponse contains the response data for a FetchCounterCommand.
FetchIndexCommand is used to fetch a search index from Riak.
FetchIndexCommandBuilder type is required for creating new instances of FetchIndexCommand command := NewFetchIndexCommandBuilder().
FetchMapCommand fetches a map CRDT from Riak.
FetchMapCommandBuilder type is required for creating new instances of FetchMapCommand command := NewFetchMapCommandBuilder().
FetchMapResponse contains the response data for a FetchMapCommand.
FetchPreflistCommand is used to fetch the preference list for a key from Riak KV.
FetchPreflistCommandBuilder type is required for creating new instances of FetchPreflistCommand preflist := NewFetchPreflistCommandBuilder().
FetchPreflistResponse contains the response data for a FetchPreflistCommand.
FetchSchemaCommand is used to GET a search schema from Riak.
FetchSchemaCommandBuilder type is required for creating new instances of FetchSchemaCommand command := NewFetchSchemaCommandBuilder().
FetchSetCommand fetches a set CRDT from Riak.
FetchSetCommandBuilder type is required for creating new instances of FetchSetCommand command := NewFetchSetCommandBuilder().
FetchSetResponse contains the response data for a FetchSetCommand.
FetchValueCommand is used to fetch / get a value from Riak KV.
FetchValueCommandBuilder type is required for creating new instances of FetchValueCommand command := NewFetchValueCommandBuilder().
FetchValueResponse contains the response data for a FetchValueCommand.
GetServerInfoCommand is used to get Riak server information.
GetServerInfoResponse contains the response data for Riak server information.
Link is used to represent a Riak KV object link, which is a one way link to another object within Riak.
ListBucketsCommand is used to list buckets in a bucket type.
ListBucketsCommandBuilder type is required for creating new instances of ListBucketsCommand cb := func(buckets []string) error { // Do something with the result return nil } cmd := NewListBucketsCommandBuilder().
ListBucketsResponse contains the response data for a ListBucketsCommand.
ListKeysCommand is used to fetch a list of keys within a bucket from Riak KV.
ListKeysCommandBuilder type is required for creating new instances of ListKeysCommand cb := func(buckets []string) error { // Do something with the result return nil } cmd := NewListKeysCommandBuilder().
ListKeysResponse contains the response data for a ListKeysCommand.
Map object represents the Riak Map object and is returned within the Response objects for both UpdateMapCommand and FetchMapCommand.
MapOperation contains the instructions to send to Riak what updates to the Map you want to complete.
MapReduceCommand is used to fetch keys or data from Riak KV using the MapReduce technique.
MapReduceCommandBuilder type is required for creating new instances of MapReduceCommand command := NewMapReduceCommandBuilder().
ModFun is used when fetching or updating LinkFun or ChashKeyfun bucket properties on Riak.
Options for creating a new Client.
Node is a struct that contains all of the information needed to connect and maintain connections with a Riak KV instance.
NodeOptions defines the RemoteAddress and operational configuration for connections to a Riak KV instance.
Object structure used for representing a KV Riak object.
Pair is used to store user defined meta data with a key and value.
PingCommand is used to verify Riak is online and reachable.
PingCommandBuilder is the command builder required for PingCommand.
PreflistItem represents an individual result from the FetchPreflistResponse result set.
PingCommand is used to verify Riak is online and reachable.
ResetBucketCommandBuilder is the command builder for ResetBucketCommand.
No description provided by the author
Schema object representing the solr schema that is returned from Riak.
SearchCommand is used to search Riak for values using search indexes & schemas.
SearchCommandBuilder type is required for creating new instances of SearchCommand command := NewSearchCommandBuilder().
SearchDoc object representing solr document returned from Riak.
SearchIndex object representing the solr index that is returned from Riak.
SearchResponse contains the response data for a SearchCommand.
SecondaryIndexQueryCommand is used to query for keys from Riak KV using secondary indexes.
SecondaryIndexQueryCommandBuilder type is required for creating new instances of SecondaryIndexQueryCommand command := NewSecondaryIndexQueryCommandBuilder().
SecondaryIndexQueryResponse contains the response data for a SecondaryIndexQueryCommand.
SecondaryIndexQueryResult represents an individual result of the SecondaryIndexQueryResponse result set.
StoreBucketPropsCommand is used to store changes to a buckets properties.
StoreBucketPropsCommandBuilder type is required for creating new instances of StoreBucketPropsCommand command := NewStoreBucketPropsCommandBuilder().
StoreBucketTypePropsCommand is used to store changes to a bucket type's properties.
StoreBucketTypePropsCommandBuilder type is required for creating new instances of StoreBucketTypePropsCommand command := NewStoreBucketTypePropsCommandBuilder().
StoreIndexCommand is sused to store a new search index on Riak.
StoreIndexCommandBuilder type is required for creating new instances of StoreIndexCommand command := NewStoreIndexCommandBuilder().
StoreSchemaCommand is used to store / update a search schema in Riak.
StoreSchemaCommandBuilder type is required for creating new instances of StoreSchemaCommand command := NewStoreSchemaCommandBuilder().
StoreValueCommand used to store a value from Riak KV.
StoreValueCommandBuilder type is required for creating new instances of StoreValueCommand command := NewStoreValueCommandBuilder().
StoreValueResponse contains the response data for a StoreValueCommand.
TsCell represents a cell value within a time series row.
TsColumnDescription describes a Time Series column.
TsDeleteRowCommand is used to delete a value from Riak TS.
TsDeleteRowCommandBuilder type is required for creating new instances of TsDeleteRowCommand cmd, err := NewTsDeleteRowCommandBuilder().
TsFetchRowCommand is used to fetch / get a value from Riak KV.
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().
TsFetchRowResponse contains the response data for a TsFetchRowCommand.
TsListKeysCommand is used to fetch values from a table in Riak TS.
TsListKeysCommandBuilder type is required for creating new instances of TsListKeysCommand cmd, err := NewTsListKeysCommandBuilder().
TsListKeysResponse contains the response data for a TsListKeysCommand.
TsQueryCommand is used to fetch / get a value from Riak TS.
TsQueryCommandBuilder type is required for creating new instances of TsQueryCommand cmd, err := NewTsQueryCommandBuilder().
TsQueryResponse contains the response data for a TsQueryCommand.
TsStoreRowsCommand is sused to store a new row/s in Riak TS.
TsStoreRowsCommandBuilder type is required for creating new instances of StoreIndexCommand cmd, err := NewTsStoreRowsCommandBuilder().
UpdateCounterCommand is used to increment or decrement a counter data type in Riak KV.
UpdateCounterCommandBuilder type is required for creating new instances of UpdateCounterCommand command := NewUpdateCounterCommandBuilder().
UpdateCounterResponse is the object containing the response.
UpdateMapCommand updates a map CRDT in Riak.
UpdateMapCommandBuilder type is required for creating new instances of UpdateMapCommand mapOp := &MapOperation{} mapOp.SetRegister("register_1", []byte("register_value_1")) command := NewUpdateMapCommandBuilder().
UpdateMapResponse contains the response data for a UpdateMapCommand.
UpdateSetCommand stores or updates a set CRDT in Riak.
UpdateSetCommandBuilder type is required for creating new instances of UpdateSetCommand adds := [][]byte{ []byte("a1"), []byte("a2"), []byte("a3"), []byte("a4"), } command := NewUpdateSetCommandBuilder().
UpdateSetResponse contains the response data for a UpdateSetCommand.

# Interfaces

Command interface enforces proper structure of a Command object.
CommandBuilder interface requires Build() method for generating the Command to be executed.
ConflictResolver is an interface to handle sibling conflicts for a key.
NodeManager enforces the structure needed to if going to implement your own NodeManager.

# Type aliases

ReplMode contains the replication mode.