This is a sms service which is a micro service,it can be used in your service for decoupling your service,Golang is the main language for this project.Http and RPC are supported,So you can choose any method you like.
You can find the dev_env file in this project,let's have a look.
This is a address for your server,port is very important,don't forget🙂
This is the database address for sms service,I suggest use mysql.🚀
This is the address for rabbitMQ,We use RabbitMQ as message middleware.😈
Both of them are for my Monitor Server,Because I use PushOver to notice me that if the sms service is healthy.😃
It's the port for Webhook service,and what's Webhook?it's just used to handle the api server's callback.🥰
source dev_env
## path: github.com/ttlv/sms
docker-compose -f docker-compose.yml up -d
we use mysql and rabbitmq as other dependent services and you can see them in the dcoker-compose file.
Use docker ps -a command to make sure dependent services are available.
cd $GOPATH/github.com/ttlv/sms/service/producer_http/main
go run main.go
cd $GOPATH/github.com/ttlv/sms/service/producer_grpc/main
go run main.go
cd $GOPATH/github.com/ttlv/sms/service/consumer
go run main.go
cd $GOPATH/github.com/ttlv/sms/webhook/main
go run main.go
cd $GOPATH/github.com/ttlv/sms/monitor
go run main.go
please jump to https://github.com/ttlv/sms_admin to have a look.
package main
import (
"github.com/ttlv/common_utils/utils"
)
// please make sure you have valid brand and the number of sms more than zero
func main() {
utils.Post("https://sms.xtv.im/send", map[string]string{
"brand": "test",
"phone": "8618000000000",
"content": "hello",
}, nil, map[string]string{
"Authorization": "Token token=123456",
})
}