Documentation
¶
Overview ¶
Package backend implements an Rest API that manages a "company" database.
This package implements a two level Key/Store Data Base: The Data Records are indexed by ID Number ID/RECORD DATA The Data Records are implemented internally as a Key/Store Data Records are made up of a variable number of TAG Pairs
. TAGS are identified by the first character which is a "|" ie |TAG
The |TAG is followed by any number of Words Example: |NAME John Smith |AGE 50 Since Records are Key/Stores the Record Format is Flexiable. Each Record can have any Tag Pairs - The User can a special Tags to Any Record: For Example: Some Records might be Flagged in some way.
Server is on localhost:3000 Responds to endpoint "/backend/<cmd> <data list>"
Command Format:
<data list> is made up a variable number of <tag pairs> <tag pairs> consist of a <|TAG> and variable number of <text words>
For Examples:
/NEW |NAME John Smith |AGE 56 /UPDATE |ID 10 |NAME Bob Lay - Changes Name Value of ID 10 Commands: /NEW <data list> - Creates a new record (Using next avaiable ID Value) /UPDATE <|ID Number> <data list> - Updates specified ID /GET/<ID string> - Returns spedified ID /DELETE/<ID Number> - Deletes specified ID /LIST/ - Lists all records in database /EXIT/ - Close Database and exit
Example: https://localhost:3000/backend/NEW |NEW John Smith |AGE 50
NOTES: - TAGs should be unique (If |NAME <string> |NAME <string> (Both will be present?) - Commands should be in UPPER CASE (For CLarity) - !TAG must be an exact match (TAG and tag are NOT the same) - There is no escape for the "|" Character as it is the TAG Prefix identifier - All <data list Tags and Words are strings! Numbers are specified as <strings>
Result List Example: CMD: LIST tagList: [] 1 |NAME John jones |AGE 50 2 |NAME John jones |AGE 50 3 |NAME John jones |AGE 50
Error Messages:
"Recoverable Errors are Display and Processing Continues"
Unrecoverable Errors are handled by the "log" package.
Click to show internal directories.
Click to hide internal directories.