docs: update test script.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2022-05-08 12:23:42 +08:00
parent 3a593aacb1
commit e89ea00626
3 changed files with 30 additions and 7 deletions

View File

@ -66,7 +66,7 @@ A push notification micro server using [Gin](https://github.com/gin-gonic/gin) f
- [FCM](https://firebase.google.com/)
- [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
@ -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 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 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):
@ -475,9 +475,11 @@ Show success or failure counts information of notification.
```json
{
"version": "v1.6.2",
"queue_max": 8192,
"queue_usage": 0,
"total_count": 77,
"busy_workers": 0,
"success_tasks": 32,
"failure_tasks": 49,
"submitted_tasks": 81,
"total_count": 81,
"ios": {
"push_success": 19,
"push_error": 38

View File

@ -32,3 +32,16 @@ run the following command.
```sh
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
```

View File

@ -3,12 +3,20 @@
{
"tokens": ["token_a", "token_b"],
"platform": 1,
"message": "Hello World iOS!"
"message": "Hello World iOS!",
"title": "Gorush with iOS"
},
{
"tokens": ["token_a", "token_b"],
"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"
}
]
}