Skip to content

This repository provides a boilerplate for building RESTful APIs using Go. It includes a structured project layout, essential packages, and best practices to help you get started quickly and efficiently.

Notifications You must be signed in to change notification settings

murprakoso/go-rest-api-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Rest API Boilerplate

This project is a boilerplate for creating a REST API using the Go (Golang) programming language.

Usage

1. Install Dependencies

Ensure that you have Go installed on your system. Then, run the following command to install project dependencies:

go mod tidy

2. Run the Application

go run main.go

The application will run on http://localhost:8080 by default.

Endpoint

Product Endpoint

Method Endpoint Handler Function Description
GET /v1/product productHandler.ShowProducts Display all products
GET /v1/product/:id productHandler.ShowProduct Display details of a product
POST /v1/product productHandler.CreateProduct Create a new product
PUT /v1/product/:id productHandler.UpdateProduct Update a product
DELETE /v1/product/:id productHandler.DestroyProduct Delete a product

Unit Endpoint

Method Endpoint Handler Function Description
GET /v1/unit unitHandler.ShowUnits Display all units
GET /v1/unit/:id unitHandler.ShowUnit Display details of a unit
POST /v1/unit unitHandler.CreateUnit Create a new unit
PUT /v1/unit/:id unitHandler.UpdateUnit Update a unit
DELETE /v1/unit/:id unitHandler.DestroyUnit Delete a unit

Regards.

About

This repository provides a boilerplate for building RESTful APIs using Go. It includes a structured project layout, essential packages, and best practices to help you get started quickly and efficiently.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages