type Opening struct {
gorm.Model
Role string
Description string
Company string
Location string
Remote bool
Link string
Salary int64
}
Field | Description |
---|---|
ID | Unique identifier for the job opening. |
Role | Job role title. |
Description | Detailed description of the job. |
Company | Company offering the job. |
Location | Location of the company. |
Remote | Indicates if the job is remote (true) or on-site (false). |
Link | Link for more information about the job or how to apply. |
Salary | Salary offered for the job, in cents. |
- Go (version 1.16 or higher) installed
- Git to clone the repository
-
Clone the repository:
git clone https://github.com/yan-pi/go-opportunities-api.git
-
Navigate to the project directory:
cd go-opportunities-api
-
Install dependencies:
go mod tidy
-
Run the application:
go run main.go
After executing the above commands, the API will be running at http://localhost:8080
.
v1.POST("/opening", handler.CreateOpeningHandler)
v1.GET("/opening", handler.ShowOpeningHandler)
v1.PUT("/opening", handler.UpdateOpeningHandler)
v1.DELETE("/opening", handler.DeleteOpeningHandler)
v1.GET("/list-openings", handler.ListOpeningHandler)
This project provides a Go API to manage job openings, using the Gin framework for routing and GORM for database interaction. The Opening
object structure and available endpoints have been specified above to facilitate understanding and usage of the API.