# README
Table of Contents
About The Project
This project is basic CRUD operation that is built using Go. It contains 5 APIs -
- Create Customer
- Fetch All Customers
- Update a Customer
- Delete a Customer
- Fetch Customer by ID
Currently when you start the application it have a mock data of 3 customers.
Built With
This project is built using Go. The Go programming language is an open source project to make programmers more productive.
Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.
Getting Started
To run the project, please include this project in go workspace.
Prerequisites
Need to have Go installed in your local machine.
Installation
Install the packages before running go run
command.
Usage
Create Customer
To create a customer using POST API - http://localhost:3000/createCustomer
, please include the following object in the request body of the request.
{
"name": "Anku",
"role" : "user",
"email": "[email protected]",
"phone": 1234,
"conacted": false
}
View Single Customer
To get a single customer, use GET API - http://localhost:3000/getCustomer/{id}
, please specify the customer id. Since, it a GET API, no request body is required.
View List of Customers
To get the entire list of the customers, use GET API - http://localhost:3000/getAllCustomers
.
Updating a Customer
To update a customer using PUT API - http://localhost:3000/updateCustomer/{id}
, please include the following object in the request body of the request.
{
"name": "anku",
"role" : "user",
"email": "[email protected]",
"phone": 123412,
"conacted": false
}
Deleting a Customer
To delete a single customer, use DELETE API - http://localhost:3000/deleteCustomer/{id}
, please specify the customer id. Since, it a GET API, no request body is required.
License
Distributed under the MIT License. See LICENSE.txt
for more information.
Contact
Your Name - Anku Garg - [email protected]