cli-example

command module
v0.0.0-...-70e62d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2019 License: BSD-2-Clause Imports: 8 Imported by: 0

README

GoDoc GitHub issues GitHub forks Go Report Card CircleCI

cli-example

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.

How to build?

You can simple: sh build.sh OR make

How to run?

Proceed using run.sh OR ./thecarousell

List of commands implemented

  • 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>
NOTE

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL