Skip to content

Commit

Permalink
build: refactor gRPC connections and update build process
Browse files Browse the repository at this point in the history
- Remove the `api_key` parameter from the notifications array
- Correct typo: change "Send messages to topics" to "Send messages to topic"
- Update example topic from `"/topics/foo-bar"` to `"highScores"`
- Replace `grpc.Dial` with `grpc.NewClient` for creating a gRPC connection
- Change build command from `./build.sh` to `make build_linux_lambda`
- Re-add `GO_IMPORT_PATH` and add `GO_VERSION` with values `github.com/appleboy/gorush` and `1.21.11`, respectively

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Jun 8, 2024
1 parent 82585b9 commit deec04f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ The Request body must have a notifications array. The following is a parameter t
| retry | int | retry send notification if fail response from server. Value must be small than `max_retry` field. | - | |
| topic | string | send messages to topics | | |
| image | string | image url to show in notification | - | only Android and Huawei |
| api_key | string | api key for firebase cloud message | - | only Android |
| to | string | The value must be a registration token, notification key, or topic. | - | only Android |
| collapse_key | string | a key for collapsing notifications | - | only Android |
| huawei_collapse_key | int | a key integer for collapsing notifications | - | only Huawei See the [detail](#huawei-notification) |
Expand Down Expand Up @@ -892,13 +891,13 @@ Add other fields which user defined via `data` field.
}
```

Send messages to topics
Send messages to topic

```json
{
"notifications": [
{
"to": "/topics/foo-bar",
"topic": "highScores",
"platform": 2,
"message": "This is a Firebase Cloud Messaging Topic Message"
}
Expand Down Expand Up @@ -1079,7 +1078,7 @@ const (

func main() {
// Set up a connection to the server.
conn, err := grpc.Dial(address, grpc.WithInsecure())
conn, err := grpc.NewClient(address, grpc.WithInsecure())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down Expand Up @@ -1182,7 +1181,7 @@ const (

func main() {
// Set up a connection to the server.
conn, err := grpc.Dial(address, grpc.WithInsecure())
conn, err := grpc.NewClient(address, grpc.WithInsecure())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down Expand Up @@ -1345,17 +1344,18 @@ Or you can deploy gorush to alternative solution like [netlify functions](https:

```toml
[build]
command = "./build.sh"
functions = "release/linux/lambda"
command = "make build_linux_lambda"
functions = "release/linux/lambda"

[build.environment]
GO_IMPORT_PATH = "github.com/appleboy/gorush"
GO111MODULE = "on"
GO111MODULE = "on"
GO_IMPORT_PATH = "github.com/appleboy/gorush"
GO_VERSION = "1.21.11"

[[redirects]]
from = "/*"
to = "/.netlify/functions/gorush/:splat"
status = 200
from = "/*"
status = 200
to = "/.netlify/functions/gorush/:splat"
```

## Stargazers over time
Expand Down

0 comments on commit deec04f

Please sign in to comment.