This repository has been archived by the owner. It is now read-only.
A Riak client written in Mozilla's Rust programming language
Rust Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build Add base client May 14, 2017
src Add base client May 14, 2017
tests Add base client May 14, 2017
.gitignore Add base client May 14, 2017
.gitmodules Add base client May 14, 2017
.travis.yml Add base client May 14, 2017
Cargo.toml Add base client May 14, 2017
LICENSE Add base client May 14, 2017
Makefile Add base client May 14, 2017
README.md Update README.md Jan 23, 2018

README.md

READ THIS FIRST

This client has been shelfed, and archived. I have no intention currently of continuing development for it due to the state of Riak itself. Because it got shelved so quickly after I started it, it never matured or became production ready. This client should be considered unsuitable for production.

riak-rust-client

Build Status Docs crates.io License

A Riak client for Rust.

Full documentation available on docs.rs.

Description

This client allows you to connect to the Protocol Buffers API of a Riak Node and use the functionality provided to send data, retrieve data, and otherwise communicate with Riak.

This client communicates directly with the Protocol Buffer API on a specified Riak node, and does not provide any abstractions around a cluster of nodes.

Requirements

  • This client is tested against Rust's stable, beta, and nightly branches. It should work with any modern Rust.

  • Intended to work with Riak KV 2.1.4+

Installation

Add riak as a Cargo.toml dependency to your project:

[dependencies]
riak = "*"

Select a specific version.

Usage

Examples

Storing an object:

use riak::Client;
use riak::object::{ObjectContent, StoreObjectReq};

// connect to Riak and ping the server
let mut riak = Client::new("10.0.0.2:8087").unwrap();
riak.ping().unwrap();

// prepare the object contents
let contents = ObjectContent::new("This is test data!".as_bytes());

// build a request to store the object
let mut store_request = StoreObjectReq::new("testbucket", contents);
store_request.set_key("testkey");

// store the object
riak.store_object(store_request).unwrap();