From ec1eaf94b90ad9a13cf838b5c82604413624ca5a Mon Sep 17 00:00:00 2001 From: Matt Goodall Date: Mon, 9 Jul 2012 00:08:32 +0100 Subject: [PATCH] More useful docs for Stream and XMPP. --- src/xmpp/stream.go | 4 ++-- src/xmpp/xmpp.go | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xmpp/stream.go b/src/xmpp/stream.go index 3d97618..d053cc7 100644 --- a/src/xmpp/stream.go +++ b/src/xmpp/stream.go @@ -20,8 +20,8 @@ type Stream struct { dec *xml.Decoder } -// Create a XML stream connection. Typically handles the encoding and decoding -// of XML data for a higher-level API, e.g. XMPP. +// Create a XML stream connection. A Steam is used by an XMPP instance to +// handle sending and receiving XML data over the net connection. func NewStream(addr string) (*Stream, error) { log.Println("Connecting to", addr) diff --git a/src/xmpp/xmpp.go b/src/xmpp/xmpp.go index 04a61e4..8f24904 100644 --- a/src/xmpp/xmpp.go +++ b/src/xmpp/xmpp.go @@ -2,7 +2,11 @@ package xmpp import "log" +// Handles XMPP conversations over a Stream. Use NewClientXMPP and/or +// NewComponentXMPP to create and configuring a XMPP instance. type XMPP struct { + // JID associated with the stream. Note: this may be negotiated with the + // server during setup and so must be used for all messages. JID JID stream *Stream in chan interface{} @@ -21,6 +25,7 @@ func newXMPP(jid JID, stream *Stream) *XMPP { return x } +// Send a stanza. func (x *XMPP) Send(v interface{}) { x.out <- v }