A Go lang microservice to interact with redis messaging queue and SFTP server
-
Clone the repository:
git clone https://github.com/jiteshchawla1511/go-redis-messaging-api.git
-
Navigate to the project directory:
cd go-redis-messaging-api
-
Install the necessary dependencies:
go mod download
-
Run the Redis Server
redis-server
-
Run the SFTP Docker file (using Docker App or terminal)
docker run -p 22:22 -d atmoz/sftp foo:pass:::upload
-
Run the main file
- Terminal 1
cd go-redis-publisher
go run main.go
- Terminal 2
cd go-redis-sftp-sync
go run main.go
POST : "http://localhost:3000/submit"
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"
}
SFTP_USER=
SFTP_PASSWORD=
SFTP_HOST=localhost
REDIS_ADDR=localhost:6379
SMTP_FROM=
SMTP_PASS=
SMTP_HOST=
SMTP_PORT=587
SNS_ARN=
AWS_REGION=
You will recieve the data from your api to your email or phone number whichever you have configured in your aws sns service
Thankyou 😄