/go-redis-messaging-api

A golang microservice to interact with redis messaging queue and SFTP server

Primary LanguageGo

Go-redis-messaging-api

A Go lang microservice to interact with redis messaging queue and SFTP server

Prerequisites

  • Go installed on your system.
  • A running Redis instance.
  • A running SFTP instance
  • AWS SNS Service

Installation

  1. Clone the repository:

    git clone https://github.com/jiteshchawla1511/go-redis-messaging-api.git
  2. Navigate to the project directory:

    cd go-redis-messaging-api
  3. Install the necessary dependencies:

    go mod download
  4. Run the Redis Server

    redis-server
  5. Run the SFTP Docker file (using Docker App or terminal)

    docker run -p 22:22 -d atmoz/sftp foo:pass:::upload
  6. Run the main file

  1. Terminal 1
cd go-redis-publisher
go run main.go
  1. Terminal 2
cd go-redis-sftp-sync
go run main.go

API Endpoints

POST : "http://localhost:3000/submit"

JSON DATA FORMAT

  type User struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Age      int64  `json:"age"`
	Location string `json:"location"`
}

Example

{
  "name": "John Doe",
  "email": "john@example.com",
  "age": 30,
  "location": "New York"
}

ENV FILE

SFTP_USER=

SFTP_PASSWORD=

SFTP_HOST=localhost

REDIS_ADDR=localhost:6379

SMTP_FROM=

SMTP_PASS=

SMTP_HOST=

SMTP_PORT=587

SNS_ARN=

AWS_REGION=

END VERDICT

You will recieve the data from your api to your email or phone number whichever you have configured in your aws sns service

Thankyou 😄