Skip to content

guilhermemcardoso/go-opportunities-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang REST API for Openings

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.

Table of Contents

Endpoints

GET /opening

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"
}

POST /opening

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"
}

PUT /opening

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 /opening

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"
}

GET /openings

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"
}

Installation

To install and run the API, follow these steps:

  1. Clone the repository:

    git clone git@github.com:guilhermemcardoso/go-opportunities-api.git

  2. Navigate to the project directory:

    cd go-opportunities-api

  3. Run the API locally:

    go run main.go

  4. Access the endpoints at localhost:8080

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published