Crates.io | service_world |
lib.rs | service_world |
version | 0.2.0 |
source | src |
created_at | 2017-11-03 15:06:51.312475 |
updated_at | 2020-04-09 14:12:12.150441 |
description | Discover services from Hasicorp's consul |
homepage | |
repository | https://github.com/lukaspustina/service-world.git |
max_upload_size | |
id | 37925 |
size | 109,452 |
service-world is a Rust and Tokio based library to query Hashicorp's Consul for nodes and services. The intention is to offer a command line tool as well as a simple webserver to discover the available nodes and services. It contains two binaries sw-discover and sw-present. sw-discover is a CLI client to display all services and nodes but also to filter by services and tags. Output can be either colored plain text or json for post-processing. sw-present is intended to generate an HTML web page which can also be served using an internal web server. The HTML is generated using the Handlebars templating language provided through handlebars-rust.
Table of Contents
Please add my PackageCloud open source repository and install service-world
via apt.
> curl -s https://packagecloud.io/install/repositories/lukaspustina/opensource/script.deb.sh | sudo bash
> sudo apt-get install service-world
You can find binary releases at GitHub.
> rustup run nightly cargo install service_world --all-features
USAGE:
sw-discover [OPTIONS] <url>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-o, --output <output module> Selects output module [default: terminal] [values: terminal, details, json]
-s, --service <service name>... Filters service for specified service names
-t, --tag <tag name>... Filters service for specified tags
ARGS:
<url> URL of consul agent to retrieve catalog from
sw-discover showing all services and nodes
sw-discover filtering for service name, showing detailed as well as JSON output.
USAGE:
sw-present [FLAGS] --config <config> [url]
FLAGS:
-h, --help Prints help information
-r, --rocket Sets Rocket mode -- activates internal web server
-V, --version Prints version information
OPTIONS:
-c, --config <config> Sets config file
ARGS:
<url> URL of consul agent to retrieve catalog from
There is a self-explanatory example configuration file in the examples subdirectory. A minimalistic example configuration showing the mandatory configuration parameters is bundled in the Debian Package distribution subdirectory. This subdirectory also includes two examples for the necessary web page templates.
There are basically three sections. A general section describing where to find consul, a start page section specifying links for the start page, and a service section. The service section may specify link templates for each search that is used to generate links for each service in the service overview. In this way, you can enrich the service view with direct URLs for each service. For examples, HAProxy services can link to their monitor web page and Elastic Search services may link to their installed management plugins etc.
sw-present start page
sw-present showing service catalog and service links
sw-present showing service navigation
You're free to use service-world. If you find it useful, I would highly appreciate you sending me a postcard from your hometown mentioning how you use service-world. My work address is
Lukas Pustina
CenterDevice GmbH
Rheinwerkallee 3
53227 Bonn
Germany