Welcome to the Golang REST API for managing job openings. This API allows you to create, read, update, and delete opening job opening records, as well as retrieve a list of all job openings.
This project was developed following the instructions from @arthur404dev. If you liked this project, give him a star here, he deserve it. If you want to learn how to develop this project, you can learn it here.
Retrieve an existing opening by its ID.
Request:
GET /opening?id={id}
Response:
{
"data": {
"ID": 2,
"CreatedAt": "2024-06-23T16:53:37.332476-03:00",
"UpdatedAt": "2024-06-23T18:18:24.178782-03:00",
"DeletedAt": null,
"Role": "Senior Ruby Engineer",
"Company": "BrasSoft",
"Location": "New York",
"Remote": true,
"Link": "vaga.com/vagazika/33298",
"Salary": 190000
},
"message": "operation from handler: show-opening successful"
}
Create a new opening.
Request:
POST /opening
Content-Type: application/json
Body
{
"role": "Senior React Engineer",
"company": "UltraSoft",
"location": "New York",
"remote": true,
"salary": 190000,
"link": "vaga.com/vagazika/33298"
}
Response:
{
"data": {
"ID": 5,
"CreatedAt": "2024-06-23T18:34:37.188478-03:00",
"UpdatedAt": "2024-06-23T18:34:37.188478-03:00",
"DeletedAt": null,
"Role": "Senior React Engineer",
"Company": "UltraSoft",
"Location": "New York",
"Remote": true,
"Link": "vaga.com/vagazika/33298",
"Salary": 190000
},
"message": "operation from handler: create-opening successful"
}
Update an existing opening.
Request:
PUT /opening?id={id}
Content-Type: application/json
Body:
{
"company": "Geegle"
}
Response:
{
"data": {
"ID": 2,
"CreatedAt": "2024-06-23T16:53:37.332476-03:00",
"UpdatedAt": "2024-06-23T18:35:29.182524-03:00",
"DeletedAt": null,
"Role": "Senior Ruby Engineer",
"Company": "Geegle",
"Location": "New York",
"Remote": true,
"Link": "vaga.com/vagazika/33298",
"Salary": 190000
},
"message": "operation from handler: update-opening successful"
}
Delete an existing opening by its ID.
Request:
DELETE /opening?id={id}
Response:
{
"data": {
"ID": 4,
"CreatedAt": "2024-06-23T16:54:47.778492-03:00",
"UpdatedAt": "2024-06-23T16:54:47.778492-03:00",
"DeletedAt": "2024-06-23T18:36:43.719817-03:00",
"Role": "Senior React Engineer",
"Company": "UltraSoft",
"Location": "New York",
"Remote": true,
"Link": "vaga.com/vagazika/33298",
"Salary": 190000
},
"message": "operation from handler: delete-opening successful"
}
Retrieve a list of all openings.
Request:
GET /openings
Response:
{
"data": [
{
"ID": 2,
"CreatedAt": "2024-06-23T16:53:37.332476-03:00",
"UpdatedAt": "2024-06-23T18:35:29.182524-03:00",
"DeletedAt": null,
"Role": "Senior Ruby Engineer",
"Company": "Geegle",
"Location": "New York",
"Remote": true,
"Link": "vaga.com/vagazika/33298",
"Salary": 190000
},
{
"ID": 3,
"CreatedAt": "2024-06-23T16:54:44.010187-03:00",
"UpdatedAt": "2024-06-23T16:54:44.010187-03:00",
"DeletedAt": null,
"Role": "Senior Python Engineer",
"Company": "UltraSoft",
"Location": "New York",
"Remote": true,
"Link": "vaga.com/vagazika/33298",
"Salary": 190000
},
{
"ID": 5,
"CreatedAt": "2024-06-23T18:34:37.188478-03:00",
"UpdatedAt": "2024-06-23T18:34:37.188478-03:00",
"DeletedAt": null,
"Role": "Senior React Engineer",
"Company": "UltraSoft",
"Location": "New York",
"Remote": true,
"Link": "vaga.com/vagazika/33298",
"Salary": 190000
}
],
"message": "operation from handler: list-openings successful"
}
To install and run the API, follow these steps:
-
Clone the repository:
git clone git@github.com:guilhermemcardoso/go-opportunities-api.git
-
Navigate to the project directory:
cd go-opportunities-api
-
Run the API locally:
go run main.go
-
Access the endpoints at
localhost:8080