AoikConsulWatcher

Watch changes of Consul services and call a handler.


Keywords
consul, watcher
License
MIT
Install
pip install AoikConsulWatcher==0.0.1

Documentation

AoikConsulWatcher

Watch changes of Consul services and call a handler.

Tested woring with:

  • Python 3.6.5, 2.7.14

Use cases:

Table of Contents

Setup

Setup via pip

Run:

pip install AoikConsulWatcher

or:

pip install git+https://github.com/AoiKuiyuyou/AoikConsulWatcher

Setup via git

Run:

git clone https://github.com/AoiKuiyuyou/AoikConsulWatcher

cd AoikConsulWatcher

python setup.py install

Usage

Run program

Run:

aoikconsulwatcher

Or:

python -m aoikconsulwatcher

Or:

cd AoikConsulWatcher

python src/aoikconsulwatcher/__main__.py

Specify config module

Config module specifies the Consul server to connect to, and the handler handle_service_infos to be called on changes of Consul services.

An example config module is src/aoikconsulwatcher/config.py.

Create a config file:

cd AoikConsulWatcher

cp src/aoikconsulwatcher/config.py config.py 

Use the config file:

aoikconsulwatcher --config config.py