Crates.io | ruroonga_client |
lib.rs | ruroonga_client |
version | 0.5.1 |
source | src |
created_at | 2016-01-10 08:20:19.209541 |
updated_at | 2017-03-03 12:47:32.086845 |
description | A tiny Groonga HTTP client. |
homepage | https://github.com/cosmo0920/ruroonga_client |
repository | |
max_upload_size | |
id | 3858 |
size | 30,394 |
A tiny Groonga client mainly via HTTP written by Rust language.
GQTP protocol support is experimental for now.
Add following lines to your Cargo.toml:
[dependencies]
ruroonga_client = "~0.5.0"
and following lines to your crate root:
extern crate ruroonga_client;
use ruroonga_client as groonga;
If you want to use GQTP module, please specify the dependency as follows for now:
[dependencies.ruroonga_client]
version = "~0.5.0"
features = ["gqtp"]
extern crate ruroonga_client as groonga;
use groonga::builtin::command_query::CommandQuery;
fn main() {
let mut request = groonga::HTTPRequest::new();
let mut command = CommandQuery::new("select");
command.set_argument(vec![("table", "Sites")]);
let uri_base = groonga::URIBase::new().build();
let url = groonga::RequestURI::new(uri_base, command.encode()).url();
println!("url: {}", url);
let res = request.get(url);
let result = request.receive(&mut res.unwrap()).unwrap();
println!("result: {}", result);
}
Execute cargo test
.
If you encountered building failure which is dependent openssl library, you should define several environment variables.
You can use homebrewed openssl like this:
$ export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
$ export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib
And then, cargo build
.
In more detail, see: https://github.com/sfackler/rust-openssl#windows
MIT.