diff options
| author | Shulhan <ms@kilabit.info> | 2023-09-11 00:42:21 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-09-11 02:26:33 +0700 |
| commit | ba9e78e7f0fc026db34d125d187a42e7e4f6e961 (patch) | |
| tree | 93452613e227211a4a35b81a38ce8a12beefa800 /lib/websocket | |
| parent | 584b0b372ae0ea69d4fb1f6941c435b9526ddba5 (diff) | |
| download | pakakeh.go-ba9e78e7f0fc026db34d125d187a42e7e4f6e961.tar.xz | |
websocket/examples: add missing comments
While at it, realign struct Account to make the size reduced from 32
to 24 bytes (-8).
Diffstat (limited to 'lib/websocket')
| -rw-r--r-- | lib/websocket/examples/account.go | 4 | ||||
| -rw-r--r-- | lib/websocket/examples/examples.go | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/websocket/examples/account.go b/lib/websocket/examples/account.go index 1f5de70f..fafafd76 100644 --- a/lib/websocket/examples/account.go +++ b/lib/websocket/examples/account.go @@ -6,12 +6,12 @@ package examples // Account represent an example of internal user in the system. type Account struct { - ID int64 Name string Key string // The Key to authenticate user during handshake. + ID int64 } -// List of user's account in the system. +// Users contain list of user's account in the system. var Users map[int64]*Account = map[int64]*Account{ 1: { ID: 1, diff --git a/lib/websocket/examples/examples.go b/lib/websocket/examples/examples.go index 144adbc5..34c926e7 100644 --- a/lib/websocket/examples/examples.go +++ b/lib/websocket/examples/examples.go @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Package examples provide an example on how to use WebSocket server and +// client. package examples +// List of message type broadcasted by server. const ( BroadcastMessage = "message" BroadcastSystem = "system" |
