From 0e637e09a454c9e55a862ede7889ac4e952efcc7 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Wed, 5 Apr 2017 14:59:40 +0200 Subject: [PATCH] Add start of IRC client spec draft --- docs/asgi/irc-client.rst | 81 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 docs/asgi/irc-client.rst diff --git a/docs/asgi/irc-client.rst b/docs/asgi/irc-client.rst new file mode 100644 index 0000000..cfdecd7 --- /dev/null +++ b/docs/asgi/irc-client.rst @@ -0,0 +1,81 @@ +=========================================== +IRC Client ASGI Message Format (Draft Spec) +=========================================== + +.. warning:: + This is an incomplete draft. + +Represents communication with an external IRC server as a client. It is possible +to have multiple clients hooked into the same channel layer talking to different +servers, which is why the reply channel is not a fixed name; +a client will provide it with every incoming action and upon connection. + +The reply channel must stay consistent throughout the client's lifetime, so it +can be used as a unique identifier for the client. + + +Connected +--------- + +Sent when the client has established a connection to an IRC server. + +Channel: ``irc-client.connect`` + +Keys: + +* ``reply_channel``: The channel to send messages or actions to the server over. + +* ``server``: A two-item list of ``[hostname, port]``, where hostname is a + unicode string of the server hostname or IP address, and port is the integer port. + + +Joined +------ + +Sent when the client has joined an IRC channel. + +Channel: ``irc-client.join`` + +Keys: + +* ``reply_channel``: The channel to send messages or actions to the server over. + +* ``channel``: Unicode string name of the IRC channel joined + + +Receive +------- + +Represents either a message, action or notice being received from the server. + +Channel: ``irc-client.receive`` + +Keys: + +* ``reply_channel``: The channel to send messages or actions to the server over. + +* ``type``: Unicode string, one of ``message``, ``action`` or ``notice``. + +* ``user``: IRC user as a unicode string (including host portion) + +* ``channel``: IRC channel name as a unicode string + +* ``body``: Message, action or notice content as a unicode string + + +Control +------- + +Sent to control the IRC client. + +Channel: Specified by the server as ``reply_channel`` in other types + +Keys: + +* ``channel``: IRC channel name to act on as a unicode string + +* ``type``: Unicode string, one of ``join``, ``part``, ``message`` or + ``action``. + +* ``body``: If type is ``message`` or ``action``, the body of the message + or the action as a unicode string.