Golang Restful API Messaging using GORM ORM (MySQL) Gorilla Mux

Golang Restful API Messaging using GORM ORM (MySQL) Gorilla Mux

Getting Started

Folder Structure

This is my folder structure under my $GOPATH or $HOME/your_username/go.


.

|-- bin

+-- src

| |-- .env

| |-- main.go

| +-- controllers

| | |-- usersController.go

| +-- models

| | |-- base.go

| | |-- user.go

| +-- routes

| | |-- api.go

| +-- utils

| | |-- utils.go

Download the packages used to create this rest API

Run the following Golang commands to install all the necessary packages. These packages will help you set up a web server, ORM for interacting with your db, mysql driver for db connection and load your .env file or setting up environment variables respectively.


go get

Running documentation locally (Only documentation of packages your have installed)

For offline documentation on the following packages run godoc -http :6060 and then visit http://localhost:6060. Note that you can change the port to your preferred port number.

Setting configuration file

Create a .env file in the root of the project and set the following parameters


base_url=http://base_url.com base url

  

db_name=db name

db_user=db username

db_pass=db password

db_type=db type eg mysql

db_host=db host

db_port=db port

charset=utf8

parse_time=True

timezone=Asia%2FJakarta format time

web_port=5900 your web service's port

prefix=/api/v1 your prefix

  

one_signal_key= one signal key

one_signal_server= one signal server

  
  
  

waave_cell_name= your wave cell name

wave_cell_url= your wave cell url

wave_cell_key= your wave cell key

  

mailgun_domain= your mailgun domain

mailgun_private_api= your mailgun private key

mailgun_sender_email= your mailgun sender email

  

ONE_SIGNAL_USER_KEY= your one signal user key

ONE_SIGNAL_APP_KEY= your one signal app key

ONE_SIGNAL_APP_ID= your one signal app id

Owner
Septian Ramadhan
Lets do some experiment
Septian Ramadhan
Similar Resources

A demonstration of the transactional outbox messaging pattern (+ Log Trailing) with Amazon DynamoDB (+ Streams) written in Go

🎇 Gluon A composable message bus for Event-Driven systems written in Go.

Apr 12, 2022

Go-threema - Threema messaging from Go

Threema messaging from Go This is a Threema bot library written in Go. It uses p

Nov 6, 2022

API for sending sms through the connected modem using golang

SMS sender API API for making SMS sending from modem, by sending post request to route Request for Send SMS url method 127.0.0.1:8000/api/v1/send-mode

Nov 5, 2021

It's client library written in Golang for interacting with Linkedin Cruise Control using its HTTP API.

go-cruise-control It's client library (written in Golang) for interacting with Linkedin Cruise Control using its HTTP API. Supported Cruise Control ve

Jan 10, 2022

Golang API wrapper for MangaDex v5's MVP API.

mangodex Golang API wrapper for MangaDex v5's MVP API. Full documentation is found here. This API is still in Open Beta, so testing may not be complet

Oct 23, 2022

Insta API using Go and Mongodb

Insta API using Go and Mongodb

Insta-API HTTP JSON API that can be used to perform basic tasks of Creating User, Creating Post, Getting User & Post details through their Unique ID.

May 1, 2022

Mizu - API traffic viewer for Kubernetes enabling you to view all API communication between microservices

Mizu - API traffic viewer for Kubernetes enabling you to view all API communication between microservices

The API Traffic Viewer for Kubernetes A simple-yet-powerful API traffic viewer f

Jan 9, 2023

Using golang to produce data to kinesis data stream

Using golang to produce data to kinesis data stream What is this The idea behind this repo was to quickly determine how easy it would be to add a serv

Dec 22, 2022

ZenQ - A low-latency thread-safe queue in golang implemented using a lock-free ringbuffer

ZenQ A low-latency thread-safe queue in golang implemented using a lock-free ringbuffer Features Much faster than native channels in both SPSC (single

Jan 8, 2023
Related tags
A quick introduction to how Apache Kafka works and differs from other messaging systems using an example application.
A quick introduction to how Apache Kafka works and differs from other messaging systems using an example application.

Apache Kafka in 6 minutes A quick introduction to how Apache Kafka works and differs from other messaging systems using an example application. In thi

Oct 27, 2021
websocket based messaging server written in golang

Guble Messaging Server Guble is a simple user-facing messaging and data replication server written in Go. Overview Guble is in an early state (release

Oct 19, 2022
Golang client for NATS, the cloud native messaging system.

NATS - Go Client A Go client for the NATS messaging system. Installation # Go client go get github.com/nats-io/nats.go/ # Server go get github.com/na

Jan 5, 2023
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.

Beaver A Real Time Messaging Server. Beaver is a real-time messaging server. With beaver you can easily build scalable in-app notifications, realtime

Jan 1, 2023
Scalable real-time messaging server in language-agnostic way
Scalable real-time messaging server in language-agnostic way

Centrifugo is a scalable real-time messaging server in language-agnostic way. Centrifugo works in conjunction with application backend written in any

Jan 2, 2023
Abstraction layer for simple rabbitMQ connection, messaging and administration
Abstraction layer for simple rabbitMQ connection, messaging and administration

Jazz Abstraction layer for quick and simple rabbitMQ connection, messaging and administration. Inspired by Jazz Jackrabbit and his eternal hatred towa

Dec 12, 2022
A dead simple Go library for sending notifications to various messaging services.
A dead simple Go library for sending notifications to various messaging services.

A dead simple Go library for sending notifications to various messaging services. About Notify arose from my own need for one of my api server running

Jan 7, 2023
A realtime distributed messaging platform
A realtime distributed messaging platform

Source: https://github.com/nsqio/nsq Issues: https://github.com/nsqio/nsq/issues Mailing List: [email protected] IRC: #nsq on freenode Docs:

Dec 29, 2022
High-Performance server for NATS, the cloud native messaging system.
High-Performance server for NATS, the cloud native messaging system.

NATS is a simple, secure and performant communications system for digital systems, services and devices. NATS is part of the Cloud Native Computing Fo

Jan 2, 2023
Go client library SDK for Ably realtime messaging service

Ably Go A Go client library for www.ably.io, the realtime messaging service. Installation ~ $ go get -u github.com/ably/ably-go/ably Feature support T

Dec 2, 2022