HTTP Rest API in Golang

Database configuration (for MacOS)

Useful article - click to read

  1. Install postgres
  2. Run cd /Library/PostgreSQL/13/bin
  3. Run sudo -u postgres ./createdb restapi_dev to create new database
  4. Install migrate tool
  5. Run migrate create -ext sql -dir migrations create_users
  6. Define up and down migrations
  7. Run migrate -path migrations -database "postgres://localhost/restapi_dev?sslmode=disable&user=postgres&password=qwe123QWE" up
  8. Check DB: sudo -u postgres ./psql -d restapi_dev
  9. Create new DB for tests: sudo -u postgres ./createdb restapi_test
  10. Run migration for test DB: migrate -path migrations -database "postgres://localhost/restapi_test?sslmode=disable&user=postgres&password=qwe123QWE" up

model - keeps all database models

Store - kind of black-box instance, which provides public methods to work with the data. It can contain multiple repositories:

  • User repository (create user / find in DB by parameters)
  • To be updated

Store -> config.go - config for the store

Models - contains models of data representation.

Similar Resources

Opinionated Go starter with gin for REST API, logrus for logging, viper for config with added graceful shutdown

go-gin-starter An opinionated starter for Go Backend projects using: gin-gonic/gin as the REST framework logrus for logging viper for configs Docker f

Dec 2, 2022

A Go REST API allowing me to send messages to myself, on my phone, according to some events.

A Go REST API allowing me to send messages to myself, on my phone, according to some events.

go-telegram-notifier go-telegram-notifier A Go REST API wrapping the official Telegram API and used to send myself notifications, on my phone, based o

Apr 27, 2022

Mattermost Posts via its REST API v4

Mattermost Posts via its REST API v4

A Go (golang) simple client for sending Mattermost posts via its REST API v4. This program makes use of the Go libraries http and url for interacting with a Mattermost server and Cobra coupled with Viper to implement the CLI interface.

Dec 1, 2022

Go WhatsApp REST API Implementation Using Fiber And Swagger

Go WhatsApp REST API Implementation Using Fiber And Swagger

Go WhatsApp REST API Implementation Using Fiber And Swagger Package cooljar/go-whatsapp-fiber Implements the WhatsApp Web API using Fiber web framewor

May 9, 2022

go gin rest api

go-gin-rest-api-f1 go-gin-rest-api Tutorial from: https://golang.org/doc/tutorial/web-service-gin I just used F1 Drivers. go get . to get gin go run .

Oct 20, 2021

REST API boilerplate built with go and clean architecture - Echo Framework

GO Boilerplate Prerequisite Install go-migrate for running migration https://github.com/golang-migrate/migrate App requires 2 database (postgreSQL an

Jan 2, 2023

Simple REST API to get time from many different timezones

Timezone API Simple REST API for getting current time in different timezones. This is the first assignment from Rest-Based Microservices API Developme

Oct 31, 2021

REST API with Echo Framework from Go

REST API with Echo Framework from Go

REST API with Echo Framework from Go

Nov 16, 2021

Learn REST API with Go

web-w-go Enviroment Requirement go version go1.17.3 linux/amd64 Using go module github.com/cosmtrek/air - Auto reload VS Code Linux OS Go-gin framewor

Dec 26, 2021
REST API made using native Golang libraries. This API resembles the basic working of Instagram.
REST API made using native Golang libraries. This API resembles the basic working of Instagram.

Golang RESTful API for Instagram A Go based REST API built using native libraries. The API has been thoroughly worked through with Postman. Routes inc

Mar 16, 2022
šŸ Elegant Golang REST API Framework
šŸ Elegant Golang REST API Framework

An Elegant Golang Web Framework Goyave is a progressive and accessible web application framework focused on REST APIs, aimed at making backend develop

Jan 9, 2023
A rest api with the crud methods made it in golang
A rest api with the crud methods made it in golang

go-API-REST A rest api made it in golang that connects to a mongodb database This API is compatible with the Angular frontend from https://github.com/

Apr 26, 2022
A Simple REST API Build Using Golang

gorestapi A Simple REST API Build Using Golang About gorestapi: a simple music restapi that retrives info about the author, album name, price of it ge

Nov 21, 2021
API REST with Golang. Not directly mine.

REST API: API REST with HTTP Methods like: GET & GET ONE PUT POST DELETE To build a compiled server: CompiledDaemon To develop on a compiled server:

Dec 15, 2021
Example Golang API backend rest implementation mini project Point Of Sale using Gin Framework and Gorm ORM Database.

Example Golang API backend rest implementation mini project Point Of Sale using Gin Framework and Gorm ORM Database.

Dec 23, 2022
API Rest em Golang e MongoDB com autenticaĆ§Ć£o com JWT afim de testes e simulaƧoes

goRestApi API Rest em Golang e MongoDB com autenticaĆ§Ć£o com JWT afim de testes e simulaƧoes Como construir um layout de projeto extensĆ­vel AutenticaĆ§Ć£

Nov 8, 2021
Simple REST-API implementation using Golang with several packages (Echo, GORM) and Docker

Simple REST-API Boilerplate This is a simple implementation of REST-API using Golang and several packages (Echo and GORM). By default, I use PostgreSQ

Sep 13, 2022
Kubewrap - kubewrap is an kubernetes command line utility with a focus to explore the kubernetes REST API's leveraging the go libraries available along with golang and cobra packages.

Kubewrap kubewrap is an kubernetes cli wrapper with a focus to explore the kubernetes REST API's leveraging the go libraries available along with gola

Nov 20, 2022
REST api using fiber framework written in golang and using firebase ecosystem to authentication, storage and firestore as a db and use clean architecture as base
REST api using fiber framework written in golang and using firebase ecosystem to authentication, storage and firestore as a db and use clean architecture as base

Backend API Example FiberGo Framework Docs : https://github.com/gofiber Info This application using firebase ecosystem Firebase Auth Cloud Storage Fir

May 31, 2022