1
0
Fork 0

Documentation tweaks and additions.

This commit is contained in:
Matt Goodall 2012-07-12 00:40:55 +01:00
parent 20c380ebc6
commit 6dfd9e096b
3 changed files with 8 additions and 6 deletions

View File

@ -6,11 +6,13 @@ import (
) )
const ( const (
// Standard port for XMPP clients to connect to.
XMPP_CLIENT_PORT = 5222 XMPP_CLIENT_PORT = 5222
) )
// Perform a DNS SRV lookup and return an ordered list of "host:port" TCP // Perform a DNS SRV lookup and return an ordered list of "host:port" TCP
// addresses for the JID's home server. // addresses for the JID's home server. If no SRV records are found then assume
// the JID's domain is also the home server.
func HomeServerAddrs(jid JID) (addr []string, err error) { func HomeServerAddrs(jid JID) (addr []string, err error) {
// DNS lookup. // DNS lookup.

View File

@ -1,12 +1,12 @@
/* /*
Tools for implementing XMPP clients and components. Package for implementing XMPP clients and components.
The package is built on the concept of an XML stream - a pair of XML The package is built around the concept of an XML stream - a pair of XML
documents written to and read from a TCP connection. Top-level elements in documents written to and read from a TCP connection. Top-level elements in
the document form the messages processed by either end of the connection. the document form the messages processed by either end of the connection.
An XML stream is then configured for an XMPP conversation, as either a An XML stream is then configured for an XMPP conversation, as either a
client (chat, etc client) or component (a sort of server plugin). client (chat, etc) or component (a sort of server plugin).
Create a client: Create a client:

View File

@ -6,8 +6,8 @@ import (
"sync" "sync"
) )
// Handles XMPP conversations over a Stream. Use NewClientXMPP and/or // Handles XMPP conversations over a Stream. Use NewClientXMPP or
// NewComponentXMPP to create and configuring a XMPP instance. // NewComponentXMPP to create and configure a XMPP instance.
type XMPP struct { type XMPP struct {
// JID associated with the stream. Note: this may be negotiated with the // JID associated with the stream. Note: this may be negotiated with the
// server during setup and so must be used for all messages. // server during setup and so must be used for all messages.