An open API service indexing awesome lists of open source software.

https://github.com/mishnit/parking_lot

A Golang GRPC Microservice with REST and command line interface
https://github.com/mishnit/parking_lot

command-line-tool golang grpc microservices parking-lot rest-api

Last synced: about 1 month ago
JSON representation

A Golang GRPC Microservice with REST and command line interface

Awesome Lists containing this project

README

          

## 🚗 PARKING LOT 1.4.2:

A Golang GRPC Microservice with REST and command line interface (Dockerised Application)

## 🦉 REQUIREMENTS:
```
go version go1.13.1 linux/amd64 (for installing dependencies in vendor folder and building commands in build folder)
docker-compose version 1.21.2
Docker version 19.03.2
```

## 🙈 RUN UNIT TESTS + BUILD:
```
$ ./bin/setup
```

## 😼 RUN FUNCTIONAL SPECS CHECK:
```
$ ./bin/run_functional_tests
```

## 🦄 RUN INTERACTIVE SHELL:
```
$ ./bin/parking_lot
```

## 🏆 COMMANDS USAGE:
```
create_parking_lot Create Parking lot of size n
park Park car in the first available slot from entry gate
leave Unpark car from given slot num
status List all occupied slots along with car details
registration_numbers_for_cars_with_colour List car registration numbers having specific colour
slot_numbers_for_cars_with_colour List slot numbers parked with car having specific colour
slot_number_for_registration_number Display slot number for given car registration number
exit Exit from shell
```

## 🐶 PASS FILE AS AN ARGUMENT (TEST CASES):
```
$ ./build/parking_lot bin/fixtures/file_input.txt
```

## 🚀 REST APIS:
```
http://localhost:3569/swagger-parking/
```

## 🐞 ERROR CODES AND MESSAGES:
```
ErrLotSizeLTEZero Lot size cannot be <= zero
ErrNoLotFound No lot available, please create a lot first
ErrParkingFull Sorry, parking lot is full
ErrInvalidSlot Slot invalid
ErrParking Parking slot is empty
ErrInvalidCarNumber Invalid indian car number plate format
ErrNotFound Not found
Error Unexpected error occured
ErrInvalidCommand Invalid command
RegexCarNumber ^[A-Z]{2}-[0-9]{2}-[A-Z]{1,2}-[0-9]{1,4}$
```

## 😎 AUTHOR:

- Nitin Mishra
- geekymishnit@gmail.com
- +91-9535507255