https://github.com/windomz/go-alidayu
:mailbox_with_mail: Light, queue and faster for alidayu API
https://github.com/windomz/go-alidayu
alidayu go golang
Last synced: about 1 year ago
JSON representation
:mailbox_with_mail: Light, queue and faster for alidayu API
- Host: GitHub
- URL: https://github.com/windomz/go-alidayu
- Owner: WindomZ
- License: mit
- Created: 2016-02-16T09:40:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-06-22T16:10:33.000Z (almost 9 years ago)
- Last Synced: 2025-02-15T07:42:12.527Z (over 1 year ago)
- Topics: alidayu, go, golang
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-alidayu
## Overview
* 基于最新[阿里大鱼API](http://www.alidayu.com/doc)
* 支持短信验证码、语音双呼、文本转语音通知、语音通知及短信发送记录查询
* 提供了简单轻量化的并发队列
* 方便自行封装
* 支持回调跟踪
## Installation
```bash
go get -u github.com/WindomZ/go-alidayu
```
## Usage
```go
package main
import . "github.com/WindomZ/go-alidayu"
func init() {
InitAlidayu(true, "12345678", "88888888888888888888888888888888") // 初始化服务, 配置Key和Secret
}
func main() {
// 构建短信
msg := NewMessageSms("身份验证").SetTel("13088888888").
SetContent(
"SMS_1234567",
map[string]string{
"code": "1",
"product": "2",
},
)
// 异步发送短信
if err := SendMessageQueue(msg, func(msg interface{}, cnt int, err error) {
}); err != nil {
panic(err)
}
// Or 同步发送短信
if err := SendMessageDirect(msg); err != nil {
panic(err)
}
`...do other things...`
}
```
## Documentation
可以先基于 *_test.go 进行了解
(需要在`tests/init.go`中配置正确的API调用参数)
完善中...
## TODO
* 简洁方便的文档
* 语音双呼、文本转语音通知、语音通知的测试用例
* 提供封装实例方案
* 更多阿里大鱼反馈支持
## LICENSE
MIT(http://opensource.org/licenses/mit-license.php)