Categorygithub.com/aogallo/go-server
modulepackage
0.0.0-20250103183916-c9245e67417e
Repository: https://github.com/aogallo/go-server.git
Documentation: pkg.go.dev

# README

Rest API with Golang

Table of Contents

About Project

Tech Stack

  • Golang: Programing Language
  • Gin: Gin is a HTTP web framework written in Go (Golang)
  • Gorm: The fantastic ORM library for Golang
  • Postgresql: Database

Getting Started

Prerequisites

Make sure Go and Postgresql are installed.

Environment Variables

This repository connects to Postgresql database, so create a .env file and add the following variables if you have Postgresql locally:

 DATABASE_URL="host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai"

Run Locally

Clone the project

git clone [email protected]:aogallo/go-server.git

Go to the project directory

cd go-server

Start the server in the development environment

air

Running Tests

To run tests, run the following command

go test

# Packages

No description provided by the author
No description provided by the author

# Functions

Helper function to check if user has role.

# Structs

Role model.
User model.
UserRole is the join table.