Eureka Client for Rust
This project is currently in an alpha state as indicated by the version number.
What Works
- Registering a service with Eureka
- Sending keep-alive heartbeats to Eureka
What is implemented but untested
- Making requests to services connected via Eureka
What is not implemented
- DNS and AWS resolvers
Installation
Add eureka-client
to your Cargo.toml
and add extern crate eureka_client
to your project's root.
Usage
To initialize a eureka client and register with eureka, you'll do something similar to this:
use ;
You'll need to keep this client alive for as long as you intend to be connected to Eureka. For example, in Rocket, you can manage it as state and access it via your routes as you would with other state, e.g. calling our above function:
.mount
.manage
ignite
This client registers with eureka by default. You can disable registration by setting config.eureka.register_with_eureka = false
if you just want to use this client to make requests.