Giter VIP home page Giter VIP logo

infinispan-rs's Introduction

infinispan-rs-fork

A fork of infinispan-rs with DIGEST auth for version > 12.0.x .

infinispan-rs is a Rust client for the Infinispan REST API. For now, it implements a small part of the API.

Install

Add the infinispan dependency to your Cargo.toml:

[dependencies]
infinispan-fork = "0.1"

Usage

use infinispan_fork::Infinispan;
use infinispan_fork::request;

// Create a client
let client = Infinispan::new("http://localhost:11222", "username", "password");

// Create a cache
let req = request::caches::create_local("some_cache");
let _ = client.run(&req).await.unwrap();

// Create an entry
let req = request::entries::create("some_cache", "some_entry").with_value("a_value".into());
let _ = client.run(&req).await.unwrap();

// Read the entry
let req = request::entries::get("some_cache", "some_entry");
let resp = client.run(&req).await.unwrap();

// resp is an instance of `reqwest::Response`
assert!(resp.status().is_success());
assert_eq!("a_value", resp.text_with_charset("utf-8").await.unwrap());

Check the docs to learn more.

Development

Build

cargo build

Run the tests

Some tests need Infinispan running in localhost:11222. You can run it in Docker with:

docker run -it -p 11222:11222 -e USER="username" -e PASS="password"  infinispan/server:12.0.0.Final

Then, run the tests:

cargo test

License

Apache 2.0 License

infinispan-rs's People

Contributors

davidor avatar unleashed avatar eguzki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.