Giter Site home page Giter Site logo

ethemcuhadar / homework-2-week-3-command-line-interface-bookstore-application-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from picus-security-golang-bootcamp/homework-2-week-3-ethemcuhadar

0.0 0.0 0.0 230 KB

homework-2-week-3-EthemCuhadar created by GitHub Classroom

Go 100.00%

homework-2-week-3-command-line-interface-bookstore-application-2's Introduction

Homework 2 | Week 3

Published story about concurrency concept can be seen in link below.

Medium Concurrency Link

Golang Image


This is a very simple CLI (command line interface) application in Go programming language.

The program has 5 commands:

list

search <bookName>

get <bookID>

delete <bookID>

buy <bookID> <quantity>

Usage of commands

  • Usage of list command can be seen below.
$ go run main.go list
--------------- Books ----------------
Book ID:      1001
Name:         Don Quixote
Page Number:  1072
Stock Number: 10
Price:        11.69 $
Stock Code:   543891
ISBN:         9142437239
Author:       Miguel De Cervantes Saavedra
--------------------------------------------
Book ID:      1002
Name:         One Hundred Years of Solitude
Page Number:  417
Stock Number: 15
Price:        14.5 $
Stock Code:   394536
ISBN:         2060883286
Author:       Gabriel Garcia Marquez
--------------------------------------------
Book ID:      1003
Name:         War and Peace
Page Number:  1296
Stock Number: 12
Price:        15.69 $
Stock Code:   264159
ISBN:         1400079985
Author:       Leo Tolstoy
--------------------------------------------
Book ID:      1004
Name:         Nineteen eighty four
Page Number:  328
Stock Number: 13
Price:        7.48 $
Stock Code:   660315
ISBN:         9780451524935
Author:       George Orwell
--------------------------------------------
Book ID:      1005
Name:         Madame Bovary
Page Number:  384
Stock Number: 9
Price:        14.49 $
Stock Code:   940031
ISBN:         6451418506
Author:       Gustave Flaubert
--------------------------------------------
  • Furthermore, the usage of search bookname can seen below. The user can enter a word or even a character to search a book.
$ go run main.go search solitude
------------- Related Books ----------------
----------- Searched for(solitude) --------------
Book ID:      1002
Name:         One Hundred Years of Solitude
Page Number:  417
Stock Number: 15
Price:        14.5 $
Stock Code:   394536
ISBN:         2060883286
Author:       Gabriel Garcia Marquez
--------------------------------------------
  • The usage of get bookID is shown below.
go run main.go get 1001
--------------- Related Book ----------------
Book ID:      1001
Name:         Don Quixote
Page Number:  1072
Stock Number: 10
Price:        11.69 $
Stock Code:   543891
ISBN:         9142437239
Author:       Miguel De Cervantes Saavedra
--------------------------------------------
  • The usage of delete bookID can be seen below.
go run main.go delete 1001
--------------- Related Book ----------------
Book ID:      1001
Name:         Don Quixote
Page Number:  1072
Stock Number: 10
Price:        11.69 $
Stock Code:   543891
ISBN:         9142437239
Author:       Miguel De Cervantes Saavedra
--------------------------------------------
The book whose ID number is 1001 has been deleted.
  • The usage of buy bookID quantity is shown below.
go run main.go buy 1002 5
The purchase process is done successfully
Book ID:      1002
Name:         One Hundred Years of Solitude
Page Number:  417
Stock Number: 10
Price:        14.5 $
Stock Code:   394536
ISBN:         2060883286
Author:       Gabriel Garcia Marquez

License

MIT

homework-2-week-3-command-line-interface-bookstore-application-2's People

Contributors

ethemcuhadar avatar github-classroom[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.