1
0
Fork 0

More useful docs for Stream and XMPP.

This commit is contained in:
Matt Goodall 2012-07-09 00:08:32 +01:00
parent 6416a5e1ee
commit ec1eaf94b9
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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
}