mirror of https://github.com/dapr/cli.git
change payload to data for pub/sub (#350)
This commit is contained in:
parent
98f8818260
commit
e498de9f7d
|
@ -207,16 +207,16 @@ Publish a message:
|
|||
$ dapr publish --topic myevent
|
||||
```
|
||||
|
||||
Publish a message with a payload:
|
||||
Publish a message:
|
||||
|
||||
* Linux/Mac
|
||||
```bash
|
||||
$ dapr publish --topic myevent --payload '{ "name": "yoda" }'
|
||||
$ dapr publish --topic myevent --data '{ "name": "yoda" }'
|
||||
```
|
||||
|
||||
* Windows
|
||||
```bash
|
||||
C:> dapr publish --topic myevent --payload "{ \"name\": \"yoda\" }"
|
||||
C:> dapr publish --topic myevent --data "{ \"name\": \"yoda\" }"
|
||||
```
|
||||
|
||||
### Invoking
|
||||
|
|
|
@ -33,7 +33,7 @@ var PublishCmd = &cobra.Command{
|
|||
|
||||
func init() {
|
||||
PublishCmd.Flags().StringVarP(&publishTopic, "topic", "t", "", "the topic the app is listening on")
|
||||
PublishCmd.Flags().StringVarP(&publishPayload, "payload", "p", "", "(optional) a json payload")
|
||||
PublishCmd.Flags().StringVarP(&publishPayload, "data", "d", "", "(optional) a json serialized string")
|
||||
PublishCmd.MarkFlagRequired("app-id")
|
||||
PublishCmd.MarkFlagRequired("topic")
|
||||
RootCmd.AddCommand(PublishCmd)
|
||||
|
|
|
@ -15,5 +15,5 @@ dapr publish [flags]
|
|||
| Name | Environment Variable | Default | Description
|
||||
| --- | --- | --- | --- |
|
||||
| `--help`, `-h` | | | Help for publish |
|
||||
| `--payload`, `-p` | | | A JSON payload |
|
||||
| `--data`, `-p` | | | A JSON serialized string |
|
||||
| `--topic`, `-t` | | | The topic the app is listening on |
|
Loading…
Reference in New Issue