You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -219,21 +218,65 @@ func handler(w http.ResponseWriter, r *http.Request) {
219
218
220
219
It is possible to trigger an event on one or more channels. Channel names can contain only characters which are alphanumeric, `_` or `-` and have to be at most 200 characters long. Event name can be at most 200 characters long too.
221
220
221
+
#### Custom Types
222
+
223
+
**pusher.Event**
224
+
225
+
```go
226
+
typeTriggerParamsstruct {
227
+
SocketID *string
228
+
Info *string
229
+
}
230
+
```
231
+
232
+
Note: `Info` is part of an [experimental feature](https://pusher.com/docs/lab#experimental-program).
233
+
222
234
#### Single channel
223
235
224
236
##### `func (c *Client) Trigger`
225
237
226
238
| Argument |Description |
227
239
| :-: | :-: |
228
240
| channel `string`| The name of the channel you wish to trigger on. |
229
-
| event `string`| The name of the event you wish to trigger |
241
+
| event `string`| The name of the event you wish to trigger.|
230
242
| data `interface{}`| The payload you wish to send. Must be marshallable into JSON. |
`func (c *Client) TriggerExclusive` and `func (c *Client) TriggerMultiExclusive` follow the patterns above, except a `socket_id` is given as the last parameter.
296
+
##### `func (c. *Client) TriggerMultiWithParams`
256
297
257
-
These methods allow you to exclude a recipient whose connection has that `socket_id` from receiving the event. You can read more [here](http://pusher.com/docs/duplicates).
298
+
| Argument | Description |
299
+
| :-: | :-: |
300
+
| channels `[]string`| A slice of channel names you wish to send an event on. The maximum length is 10. |
301
+
| event `string`| As above. |
302
+
| data `interface{}`| As above. |
303
+
| params `TriggerParams`| As above. |
258
304
259
-
##### Examples
305
+
| Return Value | Description |
306
+
| :-: | :-: |
307
+
| channels `TriggerChannelsList`| A struct representing channel attributes for the requested `TriggerParams.Info`|
@@ -415,15 +499,24 @@ This library allows you to query our API to retrieve information about your appl
415
499
416
500
| Argument | Description |
417
501
| :-: | :-: |
418
-
|additionalQueries `map[string]string`|A map with query options. A key with `"filter_by_prefix"` will filter the returned channels. To get number of users subscribed to a presence-channel, specify an `"info"` key with value `"user_count"`. <br><br>Pass in `nil` if you do not wish to specify any query attributes. |
502
+
|params `ChannelsParams`|The query options. The field `FilterByPrefix` will filter the returned channels. To get the number of users subscribed to a presence-channel, specify an the `Info` field with value `"user_count"`. Pass in `nil` if you do not wish to specify any query attributes. |
419
503
420
504
| Return Value | Description |
421
505
| :-: | :-: |
422
-
| channels `*pusher.ChannelsList`| A struct representing the list of channels. See below. |
506
+
| channels `ChannelsList`| A struct representing the list of channels. See below. |
423
507
| err `error`| Any errors encountered|
424
508
425
509
###### Custom Types
426
510
511
+
**pusher.ChannelsParams**
512
+
513
+
```go
514
+
typeChannelsParamsstruct {
515
+
FilterByPrefix *string
516
+
Info *string
517
+
}
518
+
```
519
+
427
520
**pusher.ChannelsList**
428
521
429
522
```go
@@ -443,12 +536,10 @@ type ChannelListItem struct {
|additionalQueries `map[string]string`|A map with query options. An `"info"` key can have comma-separated values of `"user_count"`, for presence-channels, and `"subscription_count"`, for all-channels. To use the `"subscription_count"` value, first check the "Enable subscription counting" checkbox in your App Settings on [your Pusher Channels dashboard](https://dashboard.pusher.com).<br><br>Pass in `nil` if you do not wish to specify any query attributes. |
554
+
|params `ChannelParams`|The query options. The field `Info`can have comma-separated values of `"user_count"`, for presence-channels, and `"subscription_count"`, for all-channels. To use the `"subscription_count"` value, first check the "Enable subscription counting" checkbox in your App Settings on [your Pusher Channels dashboard](https://dashboard.pusher.com).Pass in `nil` if you do not wish to specify any query attributes. |
464
555
465
556
| Return Value | Description |
466
557
| :-: | :-: |
467
-
| channel `*pusher.Channel`| A struct representing a channel. See below. |
558
+
| channel `Channel`| A struct representing a channel. See below. |
0 commit comments