MM-9674 Add plugin API for publishing custom WebSocket events (#8999)

* Add plugin API for publishing custom WebSocket events

* Add clearer payload comment

* Update comment
Этот коммит содержится в:
Joram Wilander
2018-06-27 08:46:38 -04:00
коммит произвёл GitHub
родитель 1e5c432e10
Коммит d7976549a0
5 изменённых файлов: 49 добавлений и 2 удалений

Просмотреть файл

@@ -113,6 +113,12 @@ type API interface {
// Delete will remove a key-value pair. Returns nil for non-existent keys.
KVDelete(key string) *model.AppError
// PublishWebSocketEvent sends an event to WebSocket connections.
// event is the type and will be prepended with "custom_<pluginid>_"
// payload is the data sent with the event. Interface values must be primitive Go types or mattermost-server/model types
// broadcast determines to which users to send the event
PublishWebSocketEvent(event string, payload map[string]interface{}, broadcast *model.WebsocketBroadcast)
}
var Handshake = plugin.HandshakeConfig{