diff options
-rw-r--r-- | wsp.go | 23 | ||||
-rw-r--r-- | wsx.go | 23 |
2 files changed, 23 insertions, 23 deletions
@@ -29,6 +29,29 @@ import ( ) /* + * The message format is a WebSocket message separated with spaces. + * The contents of each field could contain anything other than spaces, + * The first character of each argument cannot be a colon. As an exception, the + * last argument may contain spaces and the first character thereof may be a + * colon, if the argument is prefixed with a colon. The colon used for the + * prefix is not considered part of the content of the message. For example, in + * + * SQUISH POP :cat purr!! + * + * the first field is "SQUISH", the second field is "POP", and the third + * field is "cat purr!!". + * + * It is essentially an RFC 1459 IRC message without trailing CR-LF and + * without prefixes. See section 2.3.1 of RFC 1459 for an approximate + * BNF representation. + * + * The reason this was chosen instead of using protobuf etc. is that it + * is simple to parse without external libraries, and it also happens to + * be a format I'm very familiar with, having extensively worked with the + * IRC protocol. + */ + +/* * Split an IRC-style message of type []byte into type []string where each * element is a complete argument. Generally, arguments are separated by * spaces, and an argument that begins with a ':' causes the rest of the @@ -18,29 +18,6 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -/* - * The message format is a WebSocket message separated with spaces. - * The contents of each field could contain anything other than spaces, - * The first character of each argument cannot be a colon. As an exception, the - * last argument may contain spaces and the first character thereof may be a - * colon, if the argument is prefixed with a colon. The colon used for the - * prefix is not considered part of the content of the message. For example, in - * - * SQUISH POP :cat purr!! - * - * the first field is "SQUISH", the second field is "POP", and the third - * field is "cat purr!!". - * - * It is essentially an RFC 1459 IRC message without trailing CR-LF and - * without prefixes. See section 2.3.1 of RFC 1459 for an approximate - * BNF representation. - * - * The reason this was chosen instead of using protobuf etc. is that it - * is simple to parse without external libraries, and it also happens to - * be a format I'm very familiar with, having extensively worked with the - * IRC protocol. - */ - package main import ( |