A tiny Groonga client via HTTP written by Rust language.
Add following lines to your Cargo.toml:
toml
[dependencies]
ruroonga_client = "~0.5.0"
and following lines to your crate root:
```rust extern crate ruroonga_client;
use ruroonga_client as groonga; ```
```rust 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.setargument(vec![("table", "Sites")]); let uribase = 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:
bash
$ export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
$ export DEP_OPENSSL_INCLUDE=/usr/local/opt/openssl/include
And then, cargo build
.
In more detail, see: https://github.com/sfackler/rust-openssl#windows
MIT.