docs: update test script.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
3a593aacb1
commit
e89ea00626
12
README.md
12
README.md
|
@ -66,7 +66,7 @@ A push notification micro server using [Gin](https://github.com/gin-gonic/gin) f
|
||||||
- [FCM](https://firebase.google.com/)
|
- [FCM](https://firebase.google.com/)
|
||||||
- [HMS](https://developer.huawei.com/consumer/en/hms/)
|
- [HMS](https://developer.huawei.com/consumer/en/hms/)
|
||||||
|
|
||||||
[A live demo on Netlify](https://gorush.netlify.com/).
|
[A live demo on Netlify](https://gorush.netlify.app/).
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ A push notification micro server using [Gin](https://github.com/gin-gonic/gin) f
|
||||||
- Support send notification through [RPC](https://en.wikipedia.org/wiki/Remote_procedure_call) protocol, we use [gRPC](https://grpc.io/) as default framework.
|
- Support send notification through [RPC](https://en.wikipedia.org/wiki/Remote_procedure_call) protocol, we use [gRPC](https://grpc.io/) as default framework.
|
||||||
- Support running in Docker, [Kubernetes](https://kubernetes.io/) or [AWS Lambda](https://aws.amazon.com/lambda) ([Native Support in Golang](https://aws.amazon.com/blogs/compute/announcing-go-support-for-aws-lambda/))
|
- Support running in Docker, [Kubernetes](https://kubernetes.io/) or [AWS Lambda](https://aws.amazon.com/lambda) ([Native Support in Golang](https://aws.amazon.com/blogs/compute/announcing-go-support-for-aws-lambda/))
|
||||||
- Support graceful shutdown that workers and queue have been sent to APNs/FCM before shutdown service.
|
- Support graceful shutdown that workers and queue have been sent to APNs/FCM before shutdown service.
|
||||||
- Support different Queue as backend like [NSQ](https://nsq.io/), [NATS](https://nats.io/) or [Redis Pub/Sub](https://redis.io/topics/pubsub), defaut engine is local [Channel](https://tour.golang.org/concurrency/2).
|
- Support different Queue as backend like [NSQ](https://nsq.io/), [NATS](https://nats.io/) or [Redis streams](https://redis.io/docs/manual/data-types/streams/), defaut engine is local [Channel](https://tour.golang.org/concurrency/2).
|
||||||
|
|
||||||
See the default [YAML config example](config/testdata/config.yml):
|
See the default [YAML config example](config/testdata/config.yml):
|
||||||
|
|
||||||
|
@ -475,9 +475,11 @@ Show success or failure counts information of notification.
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"version": "v1.6.2",
|
"version": "v1.6.2",
|
||||||
"queue_max": 8192,
|
"busy_workers": 0,
|
||||||
"queue_usage": 0,
|
"success_tasks": 32,
|
||||||
"total_count": 77,
|
"failure_tasks": 49,
|
||||||
|
"submitted_tasks": 81,
|
||||||
|
"total_count": 81,
|
||||||
"ios": {
|
"ios": {
|
||||||
"push_success": 19,
|
"push_success": 19,
|
||||||
"push_error": 38
|
"push_error": 38
|
||||||
|
|
|
@ -32,3 +32,16 @@ run the following command.
|
||||||
```sh
|
```sh
|
||||||
bat POST localhost:8088/api/push < tests/test.json
|
bat POST localhost:8088/api/push < tests/test.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Here is a sample shell code to calculate factorial using while loop:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
#!/bin/bash
|
||||||
|
counter=$1
|
||||||
|
while [ $counter -gt 0 ]
|
||||||
|
do
|
||||||
|
bat POST https://gorush.netlify.app/api/push < tests/test.json
|
||||||
|
counter=$(( $counter - 1 ))
|
||||||
|
echo $counter
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
|
@ -3,12 +3,20 @@
|
||||||
{
|
{
|
||||||
"tokens": ["token_a", "token_b"],
|
"tokens": ["token_a", "token_b"],
|
||||||
"platform": 1,
|
"platform": 1,
|
||||||
"message": "Hello World iOS!"
|
"message": "Hello World iOS!",
|
||||||
|
"title": "Gorush with iOS"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tokens": ["token_a", "token_b"],
|
"tokens": ["token_a", "token_b"],
|
||||||
"platform": 2,
|
"platform": 2,
|
||||||
"message": "Hello World Android!"
|
"message": "Hello World Android!",
|
||||||
|
"title": "Gorush with Android"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tokens": ["token_a", "token_b"],
|
||||||
|
"platform": 3,
|
||||||
|
"message": "Hello World Huawei!",
|
||||||
|
"title": "Gorush with HMS"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue