Skip to content

PowerElk: A Caching elasticsearch proxy written in Rust

License

Notifications You must be signed in to change notification settings

flipchan/powerelk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PowerElk - A Caching elasticsearch proxy written in Rust

written in order to take load of elasticsearch

Using tokio, sled and reqwests

Secretly written in order to slowly replace elasticsearch with 100% Rust power

Build me:

$ git clone https://github.com/flipchan/powerelk
$ cd powerelk && cargo build --release

Run me:

Edit powerelk.toml:

[host]
bind = "0.0.0.0"
port = 18080
elasticsearchindex = "myelkindex"
elasticsearchinstance = "http://0.0.0.0:9200"
cachelocation = "/tmp/mycache"

Run

$ ./target/release/powerelk
Listening on http://0.0.0.0:1387

Test me

$ curl -v http://0.0.0.0:1387/search  -d'{"search":fluff"}'   
$ curl -v http://0.0.0.0:1387/removekey  -d'{"search":"fluff"}'   
$ curl -v http://0.0.0.0:1387/random -XGET

Default Mode

You can use Powerelk with Rust own Default::default

cat src/elk.rs

impl Default for Elk{

        fn default() -> Self {
                Self {
                instance: "http://127.0.0.1:9200".into(),
                index: "myindex".into(),}
        }
}

cat src/database.rs

impl Default for Database {
    fn default() -> Self {
        Self {
            filelocation: "/tmp/database.db".into(),
        }
    }
}

cat src/

About

PowerElk: A Caching elasticsearch proxy written in Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages