Added some godocs to a few websocket related structs (#13451)

* Added some godocs to a few websocket related structs

* Incoporate review comments

* Fix more review comments
Этот коммит содержится в:
Agniva De Sarker
2019-12-24 19:21:03 +05:30
коммит произвёл Joram Wilander
родитель 80dd2915db
Коммит f2a14ae976
3 изменённых файлов: 23 добавлений и 17 удалений

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

@@ -17,17 +17,19 @@ const (
PING_TIMEOUT_BUFFER_SECONDS = 5
)
// WebSocketClient stores the necessary information required to
// communicate with a WebSocket endpoint.
type WebSocketClient struct {
Url string // The location of the server like "ws://localhost:8065"
ApiUrl string // The api location of the server like "ws://localhost:8065/api/v3"
ConnectUrl string // The websocket URL to connect to like "ws://localhost:8065/api/v3/path/to/websocket"
Conn *websocket.Conn // The WebSocket connection
AuthToken string // The token used to open the WebSocket
Sequence int64 // The ever-incrementing sequence attached to each WebSocket action
PingTimeoutChannel chan bool // The channel used to signal ping timeouts
EventChannel chan *WebSocketEvent
ResponseChannel chan *WebSocketResponse
ListenError *AppError
Url string // The location of the server like "ws://localhost:8065"
ApiUrl string // The API location of the server like "ws://localhost:8065/api/v3"
ConnectUrl string // The WebSocket URL to connect to like "ws://localhost:8065/api/v3/path/to/websocket"
Conn *websocket.Conn // The WebSocket connection
AuthToken string // The token used to open the WebSocket connection
Sequence int64 // The ever-incrementing sequence attached to each WebSocket action
PingTimeoutChannel chan bool // The channel used to signal ping timeouts
EventChannel chan *WebSocketEvent // The channel used to receive various events pushed from the server. For example: typing, posted
ResponseChannel chan *WebSocketResponse // The channel used to receive responses for requests made to the server
ListenError *AppError // A field that is set if there was an abnormal closure of the WebSocket connection
pingTimeoutTimer *time.Timer
}