This is a simple CRUD (Create, Read, Update, Delete) API written in Go for managing user profiles. It provides endpoints for adding, retrieving, updating, and deleting user profiles.
- Create Profile: Add a new user profile with department, designation, and employee details.
- Retrieve Profiles: Retrieve all user profiles or a specific profile by ID.
- Update Profile: Update an existing user profile by ID.
- Delete Profile: Delete a user profile by ID.
- Gorilla Mux: A powerful HTTP router and URL matcher for building Go web servers.
- Install Go and set up your Go workspace.
- Clone this repository into your Go workspace.
- Install dependencies by running:
go mod tidy
- Run the server:
go run main.go
- The server will start running on
http://localhost:8080
.
POST /profiles
: Add a new profile.GET /profiles
: Retrieve all profiles.GET /profiles/{id}
: Retrieve a specific profile by ID.PUT /profiles/{id}
: Update a specific profile by ID.DELETE /profiles/{id}
: Delete a specific profile by ID.
The program demonstrates parallelized and unparallelized API calls for adding profiles. It measures and compares the time taken for both methods.