Skip to content

deepak-nii/key-value_store_CLI_web-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

key-value_store_CLI_web-service

A CLI client which consumes the web service supporting following commands:

  • get : displays the value of an existing key over HTTP.
  • set : sets the value of the given key.
  • watch : when executed this displays any new changes happening on the KV store in real time to the given key.

Installation

This script supports only Python 3.x

$ git clone https://github.com/deepak-nii/key-value_store_CLI_web-service.git
$ cd key-value_store_CLI_web-service
$ pip install -r requirements.txt

Usage

For Client

$ client.py [-h] <key> [--set] [--watch] [--root http://0.0.0.0:8080]

positional arguments:
  key

optional arguments:
  -h, --help            show this help message and exit
  --set 
  --watch
  --root http://0.0.0.0:8080

For Server

$ server.py

Example

For server

$ server.py
======== Running on http://0.0.0.0:8080 ========
(Press CTRL+C to quit)

watch: When executed this displays any new changes happening on the KV store in real time to the given key.

$ client.py random-key --watch
{"random-key": "12345"}

set: sets the value of the given key.

$ client.py random-key --set 12345

root (i.e. get) : displays the value of an existing key over HTTP.

$ client.py random-key --root http://0.0.0.0:8080
{'random-key': '12345'}

About

A simple client-server implementation of key-value store web service through CLI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages