Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rxrddd/austin-go
austin项目的golang版本,一个聚合消息推送平台
https://github.com/rxrddd/austin-go
Last synced: about 1 month ago
JSON representation
austin项目的golang版本,一个聚合消息推送平台
- Host: GitHub
- URL: https://github.com/rxrddd/austin-go
- Owner: rxrddd
- License: apache-2.0
- Created: 2022-05-03T03:05:25.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T06:44:40.000Z (almost 2 years ago)
- Last Synced: 2024-08-02T18:36:48.701Z (4 months ago)
- Language: Go
- Homepage:
- Size: 239 KB
- Stars: 84
- Watchers: 6
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zero - austin-go - 一个聚合消息推送平台,支持微信,邮件,短信,微信公众号,钉钉等多种渠道 (Libraries that use [go-zero](https://github.com/tal-tech/go-zero))
README
# austin-go
#### 介绍
austin项目的golang版本
> v1版本
#### github地址:[https://github.com/rxrddd/austin-go](https://github.com/rxrddd/austin-go)
#### gitee地址:[https://gitee.com/AbelZou/austin-go](https://gitee.com/AbelZou/austin-go)> v2版本(基于kratos重新做了一个版本)
#### github地址:[https://github.com/rxrddd/austin-v2](https://github.com/rxrddd/austin-v2)#### 项目描述
1. 基于go-zero/grpc/ants/rabbitmq/mysql/redis 写的一个聚合消息推送平台
2. 你可以学习到:
- go-zero的api和rpc层如何调用
- go-zero项目如何使用gorm,以及封装gorm对应的gorm cache
- go-zero项目中如何使用定时任务/mq消费#### 项目启动
1. 需要搭建mysql/rabbitmq/redis服务
1. 导入数据库文件:`austin-go/sql/austin.sql`并修改`send_account`表中的`config`配置
2. 修改对应的mysql/rabbitmq/redis配置
- rpc服务配置:`austin-go/app/austin-web/rpc/etc/austin.yaml`
- job服务配置:`austin-go/app/austin-job/etc/austin-job.yaml`
3.
> 手动启动
- 启动api服务:`austin-go/app/austin-web/api/austin.go`
- 启动rpc服务:`austin-go/app/austin-web/rpc/austin.go`
- 启动job服务:`austin-go/app/austin-job/rpc/austin-job.go`
> docker一键启动
- 执行 deployment-shell.sh
4. 如需要测试去重服务则修改`message_template`表中的`deduplication_config`字段
```
{"deduplication_10":{"num":1,"time":300},"deduplication_20":{"num":5}}
```
5. 使用示例
> 邮件消息
```
curl --location --request POST 'http://localhost:8888/send' \
--header 'Content-Type: application/json' \
--data-raw '{
"code": "send",
"messageParam": {
"receiver": "[email protected]",
"variables": {
"title": "测试操作",
"content": "Hello Bob and Cora!"
}
},
"messageTemplateId": 2
}'
```> 微信公众号消息
```
curl --location --request POST 'http://localhost:8888/send' \
--header 'Content-Type: application/json' \
--data-raw '{
"code": "send",
"messageParam": {
"receiver": "openId",
"variables": {
"map": {
"name":"张三12333"
},
"url": "https://www.baidu.com/"
}
},
"messageTemplateId": 4
}'//参数带颜色的
curl --location --request POST 'http://localhost:8888/send' \
--header 'Content-Type: application/json' \
--data-raw '{
"code": "send",
"messageParam": {
"receiver": "openId",
"variables": {
"map": {
"name":"张三12333|#0000FF"
},
"url": "https://www.baidu.com/"
}
},
"messageTemplateId": 4
}'
```> 钉钉自定义机器人
```
//艾特某些手机号
curl --location --request POST 'http://localhost:8888/send' \
--header 'Content-Type: application/json' \
--data-raw '{
"code": "send",
"messageParam": {
"receiver": "13588888888,13588888887",
"variables": {
"content": "测试\n换行"
}
},
"messageTemplateId": 5
}'//艾特全部人
curl --location --request POST 'http://localhost:8888/send' \
--header 'Content-Type: application/json' \
--data-raw '{
"code": "send",
"messageParam": {
"receiver": "@all",
"variables": {
"content": "测试\n换行"
}
},
"messageTemplateId": 5
}'
```#### 目录说明
```
├── app
│ ├── austin-admin 消息平台管理端
│ ├── austin-common 项目公用的一些结构体,接口定义
│ ├── austin-job 项目消费端 mq消费/定时任务
│ ├── austin-support 项目独有的一些支持方法
│ └── austin-web 项目对外提供的接口
├── common 项目使用的公共的一些方法
├── gen.md 生成api/rpc的脚本 参考goctl
└── sql 项目sql文件
```#### 项目未完成功能
1. 对接管理平台
2. 实现对应的推送信息handler
3. 文件导入实时/定时推送
4. 客户端sdk#### Thanks
go-zero : https://github.com/zeromicro/go-zero
austin : https://gitee.com/zhongfucheng/austin
ants : https://github.com/panjf2000/ants
gomail : https://gopkg.in/gomail.v2
wechat : https://github.com/silenceper/wechat
ding : https://github.com/wanghuiyt/ding