Skip to content

Instantly share code, notes, and snippets.

@giubil
Last active November 12, 2016 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giubil/891f338e3f9ae8b25e22689448ab1a3b to your computer and use it in GitHub Desktop.
Save giubil/891f338e3f9ae8b25e22689448ab1a3b to your computer and use it in GitHub Desktop.

Communication Protocol

Commands

Request (REQ)

  • REQ LIST List all the saved records
  • REQ OBJ [NAME] Get the full record
  • REQ OBJ [NAME] [[key],[key],[key],...] Get the record with specified KEY

Send (SND)

  • SND [NAME] [[key]=[value],[key]=[value],...] Save a new record with key=value pairs

Delete (DEL)

  • DEL [NAME] Delete record [NAME]

Format

Send the requests in JSON according to the following template :

{
  "type": "REQ/SND/DEL",
  "cmd": "LIST/OBJ",
  "name": "[name]",
  "vals" : [{"key":"[key]", "val":"[val]"}, {...}]
}```

If no values need to be sent, do not send it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment