4 releases
Uses old Rust 2015
0.2.1 | Jun 4, 2016 |
---|---|
0.2.0 | Mar 5, 2016 |
0.1.1 | Mar 4, 2016 |
0.1.0 | Feb 21, 2016 |
#2775 in Database interfaces
71 downloads per month
10KB
230 lines
disque-cli
Disque CLI.
Build
git clone https://github.com/iorust/disque-cli.git && cd disque-cli && cargo build --release
Run
target/release/disque-cli -h 127.0.0.1 -p 7711
More help:
target/release/disque-cli --help
Use as a crate
extern crate disque_cli;
// exports:
use disque_cli::{create_client, Client, COMMANDS, Value, encode_slice, Decoder};
Value, encode_slice, Decoder
Re-exports from the https://github.com/iorust/resp
fn create_client(host: &str, port: u16, password: &str) -> io::Result<Client>
let mut client = create_client("127.0.0.1", 7711, "").expect("Failed to connect");
client.cmd(&["hello"]).unwrap();
Client
struct Client {
// some fields omitted
}
impl Client
fn new<A: ToSocketAddrs>(addrs: A) -> Self
let mut client = Client::new((hostname, port));
fn cmd(&mut self, slice: &[&str]) -> Result<Value>
client.cmd(&["addjob", "test", "hello, world!", "100"]).unwrap(); // Value::String("hello!")
fn read_more(&mut self) -> Result<Value>
Some commands will have one more replies. This method use to read them.
client.read_more().unwrap();
COMMANDS
https://github.com/iorust/disque-cli/blob/master/src/command.rs
Dependencies
~565KB
~10K SLoC