-
Extract zip in /tmp/ directory.
-
Run on Bash: export GOPATH=/tmp/ee_pub_sub cd /tmp/ee_pub_sub/src/asig/pub go get -v ./... sudo apt install rabbitmq-server
-
Insert the JSON payload in the Json variable in /tmp/ee_pub_sub/src/asig/pub/input/input.go file
-
Publisher: main() => /tmp/ee_pub_sub/src/asig/pub/pub.go To run Publisher Execute the following in Bash: cd /tmp/ee_pub_sub/src/asig/pub go run pub.go Local Packages Used: "asig/publisher" "asig/pub/input" "asig/utils"
-
Subscriber: main() => /tmp/ee_pub_sub/src/asig/sub/sub.go To run Subscriber Execute the following in Bash: cd /tmp/ee_pub_sub/src/asig/sub go run sub.go Local Packages Used: "asig/subscriber" "asig/utils" "asig/model"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
}
But the table being created lacked all fields except the default ID, CreatedAt, UpdatedAt & DeletedAt fields,
Refrence: https://gorm.io/docs/models.html
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
Local Packages and their _test.go files: package sub: "asig/subscriber/subscriber.go" & "asig/subscriber/subscriber_test.go" package pub: "asig/publisher/publisher.go" & "asig/publisher/publisher_test.go" package utils: "asig/utils/logger.go" & "asig/utils/logger_test.go" package model: "asig/model/db.go"
-
To Test the packages Run "go test" on Bash in following directories: /tmp/ee_pub_sub/src/asig/utils/ /tmp/ee_pub_sub/src/asig/subscriber/ /tmp/ee_pub_sub/src/asig/publisher/