It is a CRUD CLI implementation using Go1.12 that simulates an user listing products. It uses CSV to store the data, and all CRUD commands and others can be implemented dinamically without the need to restart the main program to load it.
You can simple:
sh build.sh
OR
make
Proceed using run.sh
OR
./thecarousell
register
: Register an user. Only registered users can use the additional commands.
Usage:
REGISTER user1
create_listing
: Add an item for sale
Usage:
CREATE_LISTING user1 'Phone model 8' 'Black color, brand new' 1000 'Electronics'
delete_listing
: Remove an item for sale
Usage:
DELETE_LISTING user1 itemID
get_listing
: Find and print to stdout the item
Usage:
GET_LISTING user1 itemID
get_category
: Find and print to stdout all the items from a follow category
Usage:
GET_CATEGORY user1 category {sort_price|sort_time} {asc|dsc}
get_top_category
: Find an user category with the most items
Usage:
GET_TOP_CATEGORY user1
update_listing
: Update a product based on its id
Usage:
UPDATE_LISTING user1 id <title> <description> <price> <category>
We do a normalization on the command line, if you type REGISTER or ReGiStEr, we will find the right command for you. Also you can run the commands as a standalone command, just get into commands
and run it using the same parameters above.
Distributed under 2-Clause BSD License.